pi-side-chat 0.1.1 → 0.1.3

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 +40 -94
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -4,107 +4,69 @@
4
4
 
5
5
  # pi-side-chat
6
6
 
7
- A Pi extension that forks the current conversation into a temporary side chat while the main agent keeps working.
7
+ **Fork the current conversation into a side chat while the main agent keeps working.**
8
8
 
9
- ```typescript
10
- /side
11
- ```
12
-
13
- Open the overlay, ask a quick question, close it, and go back to what the main agent was already doing.
14
-
15
- ## Why
16
-
17
- This exists for the annoying in-between moments. You're in the middle of a longer task and want to ask something small without derailing the main thread: check an API detail, sanity-check an approach, inspect recent progress, or make a tiny edit off to the side.
18
-
19
- Without a side chat, you either interrupt the main agent, open a completely separate Pi session with no context, or context-switch out to the browser. None of those feel great.
20
-
21
- `pi-side-chat` gives you a fork of the current conversation in an overlay. It starts with the same context, stays separate from the main thread, and persists across close/reopen cycles until you explicitly clear it.
22
-
23
- ## Install
9
+ [![npm version](https://img.shields.io/npm/v/pi-side-chat?style=for-the-badge)](https://www.npmjs.com/package/pi-side-chat)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE)
24
11
 
25
12
  ```bash
26
13
  pi install npm:pi-side-chat
27
14
  ```
28
15
 
29
- Restart Pi and it will be auto-discovered.
16
+ https://github.com/user-attachments/assets/3a359f47-c706-46b9-8b16-d05f430d402c
30
17
 
31
- ## Quick Start
18
+ You're in the middle of a longer task and want to ask something small without derailing the main thread — check an API detail, sanity-check an approach, search something, or peek at what the main agent is doing. Open the overlay, ask, close it. Main thread never gets interrupted.
32
19
 
33
- Open side chat with `Alt+/` or `/side`.
20
+ ## Quick Start
34
21
 
35
- Ask a question and press `Enter`.
22
+ Open side chat with `Alt+/` or `/side`. Ask a question and press `Enter`.
36
23
 
37
24
  Press `Esc` to close it. Reopen with `Alt+/` to continue where you left off.
38
25
 
39
- **Toggle focus**: Press `Alt+/` again to switch back to the main editor without closing the overlay. The side chat stays visible but unfocused. Press `Alt+/` once more to refocus it.
40
-
41
- **Toggle mode**: Press `Ctrl+T` to switch from read-only mode to edit mode if you need write access.
42
-
43
- **Start fresh**: Press `Alt+R` to re-fork from the latest main context, or `Alt+N` for a blank conversation.
26
+ **Toggle focus** `Alt+/` switches between the side chat and main editor without closing the overlay.
44
27
 
45
- ## What it does
28
+ **Toggle mode** `Ctrl+T` switches between read-only and edit mode.
46
29
 
47
- ### Forks the current conversation
30
+ **Start fresh** — `Alt+R` re-forks from the latest main context. `Alt+N` starts a blank conversation.
48
31
 
49
- The overlay starts with a copy of the current branch context, so the side agent already knows what you've been working on. It does not write anything back into the main conversation history.
32
+ ## Features
50
33
 
51
- ### Starts in read-only mode
34
+ **Forks the conversation** — Starts with a copy of the current branch context. All extension tools (web_search, fetch_content, etc.) are available. Does not write back to the main conversation history.
52
35
 
53
- The safe default is read-only. That makes it useful for quick questions, code reading, and checking progress without risking accidental edits.
36
+ **Persists across close/reopen** Closing preserves the conversation. Reopening restores it. Use `Alt+R` or `Alt+N` to explicitly start fresh.
54
37
 
55
- Press `Ctrl+T` to switch between:
56
- - **read-only mode** — safe for quick questions and code reading
57
- - **edit mode** — enables write, edit, and bash tools
38
+ **Read-only by default** — Safe for quick questions and code reading. Toggle to edit mode when you need write access.
58
39
 
59
- The header shows the current mode (`[Read-only]` or `[Edit]`), and the footer shows what `Ctrl+T` will do next.
40
+ | Mode | Tools |
41
+ |------|-------|
42
+ | Read-only | read, grep, find, ls |
43
+ | Edit | read, bash, edit, write (with overlap warnings) |
60
44
 
61
- ### Warns on file overlap
45
+ **File overlap warnings** — If the side chat tries to modify a file the main agent has touched, it asks before proceeding.
62
46
 
63
- If the side chat tries to modify a file that the main agent has already touched, it asks before proceeding.
64
-
65
- ```text
66
- File Overlap
67
-
68
- Main agent has modified:
69
- src/api/handler.ts
70
-
71
- Editing may cause conflicts. Proceed?
72
- ```
73
-
74
- It does not block automatically. It just makes the conflict explicit.
75
-
76
- ### Can peek at the main agent
77
-
78
- The side agent gets a `peek_main` tool for reading recent activity from the main session.
79
-
80
- Useful prompts:
47
+ **Peek at the main agent** The `peek_main` tool reads recent activity from the main session.
81
48
 
82
49
  ```text
83
50
  What is the main agent doing right now?
84
51
  What changed since I opened this side chat?
85
- Show me the last 10 things main did.
86
52
  ```
87
53
 
88
- ### Stays out of the way
89
-
90
- The overlay is non-capturing, so you can leave it visible and switch focus back to the main editor.
91
-
92
- It opens near the top of the screen so the main editor stays visible underneath.
54
+ **Non-capturing overlay** Leave it visible and switch focus back to the main editor. Opens at the top of the screen so the main editor stays visible underneath.
93
55
 
94
56
  ## Controls
95
57
 
96
58
  | Key | Action |
97
59
  |-----|--------|
98
- | `Alt+/` | Open side chat. When already open, toggles focus between side chat and main editor. |
60
+ | `Alt+/` | Open side chat / toggle focus |
99
61
  | `Enter` | Send message |
100
- | `Esc` | Interrupt streaming, or close side chat when idle |
101
- | `Alt+R` | Close and reopen with fresh context from main |
102
- | `Alt+N` | Close and reopen with empty conversation |
103
- | `Ctrl+T` | Toggle between read-only mode and edit mode (enables write/edit/bash) |
62
+ | `Esc` | Interrupt streaming, or close when idle |
63
+ | `Alt+R` | Re-fork from latest main context |
64
+ | `Alt+N` | Start empty conversation |
65
+ | `Ctrl+T` | Toggle read-only / edit mode |
104
66
  | `PgUp` / `Shift+↑` | Scroll up |
105
67
  | `PgDn` / `Shift+↓` | Scroll down |
106
68
 
107
- ## Command reference
69
+ ## Command Reference
108
70
 
109
71
  ### `/side`
110
72
 
@@ -114,16 +76,14 @@ Opens the side chat overlay.
114
76
 
115
77
  Available to the side agent only.
116
78
 
117
- Parameters:
118
-
119
79
  | Param | Type | Description |
120
- |------|------|-------------|
121
- | `lines` | integer | Max number of recent items to inspect, default `20`, max `50` |
122
- | `since_fork` | boolean | If `true`, only show activity after the side chat was opened |
80
+ |-------|------|-------------|
81
+ | `lines` | integer | Max items to inspect (default: 20, max: 50) |
82
+ | `since_fork` | boolean | Only show activity after the side chat was opened |
123
83
 
124
84
  ## Configuration
125
85
 
126
- Create `/Users/nicobailon/.pi/agent/extensions/pi-side-chat/config.json` if you want a different shortcut.
86
+ Create a `config.json` next to the extension to change the shortcut:
127
87
 
128
88
  ```json
129
89
  {
@@ -131,32 +91,18 @@ Create `/Users/nicobailon/.pi/agent/extensions/pi-side-chat/config.json` if you
131
91
  }
132
92
  ```
133
93
 
134
- ## How it works
135
-
136
- When you open side chat, the extension clones the current session context, creates a separate agent instance, and renders it in a TUI overlay. The main agent keeps running on its own branch.
94
+ ## How It Works
137
95
 
138
- The extension also listens for main-agent tool execution events and keeps a small in-memory set of paths that have been written. When side chat is in edit mode, its write-capable tools are wrapped so they can warn before touching one of those paths.
96
+ The extension clones the current session context, creates a separate agent instance with all extension-registered tools, and renders it in a TUI overlay. Closing saves the conversation in memory so reopening restores it.
139
97
 
140
- `peek_main` reads the current session branch on demand, formats the recent messages, and returns a compact summary back to the side agent.
98
+ Main-agent tool execution events are tracked to maintain a set of written file paths. In edit mode, write-capable tools are wrapped to warn before touching those paths.
141
99
 
142
- ## File layout
143
-
144
- ```text
145
- pi-side-chat/
146
- ├── index.ts
147
- ├── side-chat-overlay.ts
148
- ├── side-chat-messages.ts
149
- ├── file-activity-tracker.ts
150
- ├── tool-wrapper.ts
151
- ├── banner.png
152
- └── README.md
153
- ```
100
+ `peek_main` reads the current session branch on demand and returns a compact summary.
154
101
 
155
102
  ## Limitations
156
103
 
157
- - Only one side chat can be open at a time.
158
- - Side chat will not open on top of another visible overlay.
159
- - Closing preserves the conversation; reopening restores it. Use Alt+R or Alt+N to start fresh.
160
- - Side chat does not merge messages back into the main thread.
161
- - Bash overlap detection is heuristic. It catches common write cases, not every possible shell write.
162
- - `peek_main` is on-demand, not a live streaming view.
104
+ - One side chat at a time
105
+ - Won't open on top of another visible overlay
106
+ - Does not merge messages back into the main thread
107
+ - Bash overlap detection is heuristic catches common write patterns, not all
108
+ - `peek_main` is on-demand, not live
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-side-chat",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Pi extension that forks the current conversation into a temporary side chat",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,7 +18,8 @@
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/nicobailon/pi-side-chat.git"
21
+ "url": "git+https://github.com/nicobailon/pi-side-chat.git",
22
+ "video": "https://github.com/nicobailon/pi-side-chat/raw/refs/heads/main/side-chat.mp4"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "@mariozechner/pi-coding-agent": "*",