pi-side-chat 0.1.1 → 0.1.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 +38 -94
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,107 +4,67 @@
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
+ 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.
30
17
 
31
18
  ## Quick Start
32
19
 
33
- Open side chat with `Alt+/` or `/side`.
34
-
35
- Ask a question and press `Enter`.
20
+ Open side chat with `Alt+/` or `/side`. Ask a question and press `Enter`.
36
21
 
37
22
  Press `Esc` to close it. Reopen with `Alt+/` to continue where you left off.
38
23
 
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.
44
-
45
- ## What it does
46
-
47
- ### Forks the current conversation
48
-
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.
24
+ **Toggle focus** `Alt+/` switches between the side chat and main editor without closing the overlay.
50
25
 
51
- ### Starts in read-only mode
26
+ **Toggle mode** `Ctrl+T` switches between read-only and edit mode.
52
27
 
53
- The safe default is read-only. That makes it useful for quick questions, code reading, and checking progress without risking accidental edits.
28
+ **Start fresh** `Alt+R` re-forks from the latest main context. `Alt+N` starts a blank conversation.
54
29
 
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
30
+ ## Features
58
31
 
59
- The header shows the current mode (`[Read-only]` or `[Edit]`), and the footer shows what `Ctrl+T` will do next.
32
+ **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.
60
33
 
61
- ### Warns on file overlap
34
+ **Persists across close/reopen** Closing preserves the conversation. Reopening restores it. Use `Alt+R` or `Alt+N` to explicitly start fresh.
62
35
 
63
- If the side chat tries to modify a file that the main agent has already touched, it asks before proceeding.
36
+ **Read-only by default** Safe for quick questions and code reading. Toggle to edit mode when you need write access.
64
37
 
65
- ```text
66
- File Overlap
67
-
68
- Main agent has modified:
69
- src/api/handler.ts
70
-
71
- Editing may cause conflicts. Proceed?
72
- ```
38
+ | Mode | Tools |
39
+ |------|-------|
40
+ | Read-only | read, grep, find, ls |
41
+ | Edit | read, bash, edit, write (with overlap warnings) |
73
42
 
74
- It does not block automatically. It just makes the conflict explicit.
43
+ **File overlap warnings** If the side chat tries to modify a file the main agent has touched, it asks before proceeding.
75
44
 
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:
45
+ **Peek at the main agent** — The `peek_main` tool reads recent activity from the main session.
81
46
 
82
47
  ```text
83
48
  What is the main agent doing right now?
84
49
  What changed since I opened this side chat?
85
- Show me the last 10 things main did.
86
50
  ```
87
51
 
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.
52
+ **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
53
 
94
54
  ## Controls
95
55
 
96
56
  | Key | Action |
97
57
  |-----|--------|
98
- | `Alt+/` | Open side chat. When already open, toggles focus between side chat and main editor. |
58
+ | `Alt+/` | Open side chat / toggle focus |
99
59
  | `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) |
60
+ | `Esc` | Interrupt streaming, or close when idle |
61
+ | `Alt+R` | Re-fork from latest main context |
62
+ | `Alt+N` | Start empty conversation |
63
+ | `Ctrl+T` | Toggle read-only / edit mode |
104
64
  | `PgUp` / `Shift+↑` | Scroll up |
105
65
  | `PgDn` / `Shift+↓` | Scroll down |
106
66
 
107
- ## Command reference
67
+ ## Command Reference
108
68
 
109
69
  ### `/side`
110
70
 
@@ -114,16 +74,14 @@ Opens the side chat overlay.
114
74
 
115
75
  Available to the side agent only.
116
76
 
117
- Parameters:
118
-
119
77
  | 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 |
78
+ |-------|------|-------------|
79
+ | `lines` | integer | Max items to inspect (default: 20, max: 50) |
80
+ | `since_fork` | boolean | Only show activity after the side chat was opened |
123
81
 
124
82
  ## Configuration
125
83
 
126
- Create `/Users/nicobailon/.pi/agent/extensions/pi-side-chat/config.json` if you want a different shortcut.
84
+ Create a `config.json` next to the extension to change the shortcut:
127
85
 
128
86
  ```json
129
87
  {
@@ -131,32 +89,18 @@ Create `/Users/nicobailon/.pi/agent/extensions/pi-side-chat/config.json` if you
131
89
  }
132
90
  ```
133
91
 
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.
92
+ ## How It Works
137
93
 
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.
94
+ 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
95
 
140
- `peek_main` reads the current session branch on demand, formats the recent messages, and returns a compact summary back to the side agent.
96
+ 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
97
 
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
- ```
98
+ `peek_main` reads the current session branch on demand and returns a compact summary.
154
99
 
155
100
  ## Limitations
156
101
 
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.
102
+ - One side chat at a time
103
+ - Won't open on top of another visible overlay
104
+ - Does not merge messages back into the main thread
105
+ - Bash overlap detection is heuristic catches common write patterns, not all
106
+ - `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.2",
4
4
  "description": "Pi extension that forks the current conversation into a temporary side chat",
5
5
  "type": "module",
6
6
  "main": "index.js",