@pi-archimedes/session-name 2.5.0 → 2.6.2

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 +22 -22
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,46 +1,46 @@
1
1
  # @pi-archimedes/session-name
2
2
 
3
- Auto session naming for the [Pi coding agent](https://github.com/earendil-works/pi).
3
+ **Find the session you meant.**
4
4
 
5
- Automatically generates concise, descriptive session titles using AI after each conversation — so your sessions are easy to find and resume later. Skips sessions already named via `--name` or `/name`, and silently handles errors.
6
-
7
- ## What you get
8
-
9
- - **Automatic naming** — fires on `agent_end` to generate a title from the first user/assistant exchange
10
- - **Smart model resolution** — supports canonical `provider/id`, bare `id`, and thinking-suffix tolerance
11
- - **Respects manual names** — skips sessions already named via `--name` or `/name`
12
- - **Ephemeral-aware** — only names sessions with a session file (skips temporary sessions)
13
- - **Race-safe** — re-checks session name before setting to avoid overwriting manual changes
14
- - **Silent failures** — any error (auth, network, etc.) is caught and ignored
5
+ Timestamps and raw hash names don't tell you what a session was *for*. Session-name gives every session a short, descriptive name based on your first exchange, so `pi -r` stops being a guessing game.
15
6
 
16
7
  ## Install
17
8
 
9
+ Standalone:
10
+
18
11
  ```bash
19
12
  pi install npm:@pi-archimedes/session-name
20
13
  ```
21
14
 
22
- Or install full meta package:
15
+ Or the full suite instead:
23
16
 
24
17
  ```bash
25
18
  pi install npm:pi-archimedes
26
19
  ```
27
20
 
28
- ## Usage
21
+ New to Pi? Pi itself is a one-time global install and needs Node.js ≥ 22.19.0:
22
+
23
+ ```bash
24
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent
25
+ ```
26
+
27
+ After installing Pi, choose one installation command above, then `cd` into your project and run `pi`. Inside the session, `/login` signs you in and `/model` picks a model — the [setup section](https://github.com/danielcherubini/pi-archimedes#setup) covers the first run. `/reload` picks the extension up in a running session.
28
+
29
+ ## How it works
29
30
 
30
- After a conversation ends (`agent_end`), the extension extracts the first user message and assistant response, sends them to the AI with a title-generation prompt, and sets the session name via `pi.setSessionName()`. The title is limited to 80 characters and stripped of surrounding quotes.
31
+ - After the first user + assistant exchange settles, it takes the first exchange (500 characters per side), asks a model to write a 3–8-word title, caps it at 80 characters, and sets the session name — with a final re-check so a name you set yourself can never be overwritten.
32
+ - **Manual names win.** If you named the session (`--name` or `/name`), naming is skipped, and it re-checks before writing.
33
+ - **It uses your current model unless you configure another.** The title is a separate model call outside the main run — with its own cost, **not reflected in the footer's totals**. A `model` setting (e.g. a cheap model) avoids spending your main model on titles.
34
+ - **Skips and retries** — Ephemeral sessions (no session file) are skipped; if the model has no configured auth, the call is skipped. Transient failures print to the console and re-try on later `agent_end` events, giving up for the session after three. It is non-blocking and unobtrusive, but "silent" is too strong: failures are logged.
31
35
 
32
36
  ## Settings
33
37
 
38
+ `~/.pi/agent/settings.json`, under `archimedes.sessionName` (strict JSON):
39
+
34
40
  | Setting | Type | Default | Description |
35
41
  |---------|------|---------|-------------|
36
- | `model` | string | _(current model)_ | Override model for title generation (e.g., `openai/gpt-4o-mini`) |
42
+ | `model` | string | _(current model)_ | Model used for title generation (e.g. `openai/gpt-4o-mini`). Canonical `provider/id`, bare IDs, and thinking-suffix forms are all resolved. Empty = current model. |
37
43
 
38
44
  On/off is managed by the suite: toggle via `/plugins` (`archimedes.sessionName.enabled`, default on).
39
45
 
40
- Settings are stored in `~/.pi/agent/settings.json` under the `archimedes.sessionName` namespace.
41
-
42
- ## Integration
43
-
44
- When installed via `pi-archimedes` (the meta package), the session-name package is automatically registered. Standalone installs work independently — it listens for `agent_end` events and uses the Pi extension API to set session names.
45
-
46
- ← Back to [pi-archimedes](../../README.md)
46
+ ← [Back to pi-archimedes](https://github.com/danielcherubini/pi-archimedes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/session-name",
3
- "version": "2.5.0",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -14,7 +14,7 @@
14
14
  ".": "./src/index.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@pi-archimedes/core": "2.5.0"
17
+ "@pi-archimedes/core": "2.6.2"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@earendil-works/pi-coding-agent": ">=0.1.0",
@@ -22,9 +22,9 @@
22
22
  "@earendil-works/pi-tui": ">=0.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@earendil-works/pi-ai": "^0.84.4",
26
- "@earendil-works/pi-coding-agent": "^0.84.4",
27
- "@earendil-works/pi-tui": "^0.84.4",
25
+ "@earendil-works/pi-ai": "^0.85.1",
26
+ "@earendil-works/pi-coding-agent": "^0.85.1",
27
+ "@earendil-works/pi-tui": "^0.85.1",
28
28
  "typescript": "^6.0.0"
29
29
  },
30
30
  "pi": {