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.
- package/README.md +38 -94
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,107 +4,67 @@
|
|
|
4
4
|
|
|
5
5
|
# pi-side-chat
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Fork the current conversation into a side chat while the main agent keeps working.**
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
/
|
|
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
|
+
[](https://www.npmjs.com/package/pi-side-chat)
|
|
10
|
+
[](LICENSE)
|
|
24
11
|
|
|
25
12
|
```bash
|
|
26
13
|
pi install npm:pi-side-chat
|
|
27
14
|
```
|
|
28
15
|
|
|
29
|
-
|
|
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
|
|
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
|
-
|
|
26
|
+
**Toggle mode** — `Ctrl+T` switches between read-only and edit mode.
|
|
52
27
|
|
|
53
|
-
|
|
28
|
+
**Start fresh** — `Alt+R` re-forks from the latest main context. `Alt+N` starts a blank conversation.
|
|
54
29
|
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
+
**Read-only by default** — Safe for quick questions and code reading. Toggle to edit mode when you need write access.
|
|
64
37
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
58
|
+
| `Alt+/` | Open side chat / toggle focus |
|
|
99
59
|
| `Enter` | Send message |
|
|
100
|
-
| `Esc` | Interrupt streaming, or close
|
|
101
|
-
| `Alt+R` |
|
|
102
|
-
| `Alt+N` |
|
|
103
|
-
| `Ctrl+T` | Toggle
|
|
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
|
|
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
|
|
122
|
-
| `since_fork` | boolean |
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
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
|