pi-side-chat 0.1.0 → 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 +42 -92
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,101 +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 disappears when you're done.
|
|
22
|
-
|
|
23
|
-
## Install
|
|
9
|
+
[](https://www.npmjs.com/package/pi-side-chat)
|
|
10
|
+
[](LICENSE)
|
|
24
11
|
|
|
25
|
-
|
|
12
|
+
```bash
|
|
13
|
+
pi install npm:pi-side-chat
|
|
14
|
+
```
|
|
26
15
|
|
|
27
|
-
|
|
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.
|
|
28
17
|
|
|
29
18
|
## Quick Start
|
|
30
19
|
|
|
31
|
-
Open side chat with `Alt+/` or `/side`.
|
|
32
|
-
|
|
33
|
-
Ask a question and press `Enter`.
|
|
34
|
-
|
|
35
|
-
Press `Esc` to close it.
|
|
36
|
-
|
|
37
|
-
**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.
|
|
38
|
-
|
|
39
|
-
**Toggle mode**: Press `Ctrl+T` to switch from read-only mode to edit mode if you need write access.
|
|
40
|
-
|
|
41
|
-
## What it does
|
|
20
|
+
Open side chat with `Alt+/` or `/side`. Ask a question and press `Enter`.
|
|
42
21
|
|
|
43
|
-
|
|
22
|
+
Press `Esc` to close it. Reopen with `Alt+/` to continue where you left off.
|
|
44
23
|
|
|
45
|
-
|
|
24
|
+
**Toggle focus** — `Alt+/` switches between the side chat and main editor without closing the overlay.
|
|
46
25
|
|
|
47
|
-
|
|
26
|
+
**Toggle mode** — `Ctrl+T` switches between read-only and edit mode.
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
**Start fresh** — `Alt+R` re-forks from the latest main context. `Alt+N` starts a blank conversation.
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
- **read-only mode** — safe for quick questions and code reading
|
|
53
|
-
- **edit mode** — enables write, edit, and bash tools
|
|
30
|
+
## Features
|
|
54
31
|
|
|
55
|
-
|
|
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.
|
|
56
33
|
|
|
57
|
-
|
|
34
|
+
**Persists across close/reopen** — Closing preserves the conversation. Reopening restores it. Use `Alt+R` or `Alt+N` to explicitly start fresh.
|
|
58
35
|
|
|
59
|
-
|
|
36
|
+
**Read-only by default** — Safe for quick questions and code reading. Toggle to edit mode when you need write access.
|
|
60
37
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
src/api/handler.ts
|
|
66
|
-
|
|
67
|
-
Editing may cause conflicts. Proceed?
|
|
68
|
-
```
|
|
38
|
+
| Mode | Tools |
|
|
39
|
+
|------|-------|
|
|
40
|
+
| Read-only | read, grep, find, ls |
|
|
41
|
+
| Edit | read, bash, edit, write (with overlap warnings) |
|
|
69
42
|
|
|
70
|
-
|
|
43
|
+
**File overlap warnings** — If the side chat tries to modify a file the main agent has touched, it asks before proceeding.
|
|
71
44
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
The side agent gets a `peek_main` tool for reading recent activity from the main session.
|
|
75
|
-
|
|
76
|
-
Useful prompts:
|
|
45
|
+
**Peek at the main agent** — The `peek_main` tool reads recent activity from the main session.
|
|
77
46
|
|
|
78
47
|
```text
|
|
79
48
|
What is the main agent doing right now?
|
|
80
49
|
What changed since I opened this side chat?
|
|
81
|
-
Show me the last 10 things main did.
|
|
82
50
|
```
|
|
83
51
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
The overlay is non-capturing, so you can leave it visible and switch focus back to the main editor.
|
|
87
|
-
|
|
88
|
-
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.
|
|
89
53
|
|
|
90
54
|
## Controls
|
|
91
55
|
|
|
92
56
|
| Key | Action |
|
|
93
57
|
|-----|--------|
|
|
94
|
-
| `Alt+/` | Open side chat
|
|
58
|
+
| `Alt+/` | Open side chat / toggle focus |
|
|
95
59
|
| `Enter` | Send message |
|
|
96
|
-
| `Esc` |
|
|
97
|
-
| `
|
|
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 |
|
|
98
64
|
| `PgUp` / `Shift+↑` | Scroll up |
|
|
99
65
|
| `PgDn` / `Shift+↓` | Scroll down |
|
|
100
66
|
|
|
101
|
-
## Command
|
|
67
|
+
## Command Reference
|
|
102
68
|
|
|
103
69
|
### `/side`
|
|
104
70
|
|
|
@@ -108,16 +74,14 @@ Opens the side chat overlay.
|
|
|
108
74
|
|
|
109
75
|
Available to the side agent only.
|
|
110
76
|
|
|
111
|
-
Parameters:
|
|
112
|
-
|
|
113
77
|
| Param | Type | Description |
|
|
114
|
-
|
|
115
|
-
| `lines` | integer | Max
|
|
116
|
-
| `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 |
|
|
117
81
|
|
|
118
82
|
## Configuration
|
|
119
83
|
|
|
120
|
-
Create
|
|
84
|
+
Create a `config.json` next to the extension to change the shortcut:
|
|
121
85
|
|
|
122
86
|
```json
|
|
123
87
|
{
|
|
@@ -125,32 +89,18 @@ Create `/Users/nicobailon/.pi/agent/extensions/pi-side-chat/config.json` if you
|
|
|
125
89
|
}
|
|
126
90
|
```
|
|
127
91
|
|
|
128
|
-
## How
|
|
129
|
-
|
|
130
|
-
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
|
|
131
93
|
|
|
132
|
-
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.
|
|
133
95
|
|
|
134
|
-
|
|
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.
|
|
135
97
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```text
|
|
139
|
-
pi-side-chat/
|
|
140
|
-
├── index.ts
|
|
141
|
-
├── side-chat-overlay.ts
|
|
142
|
-
├── side-chat-messages.ts
|
|
143
|
-
├── file-activity-tracker.ts
|
|
144
|
-
├── tool-wrapper.ts
|
|
145
|
-
├── banner.png
|
|
146
|
-
└── README.md
|
|
147
|
-
```
|
|
98
|
+
`peek_main` reads the current session branch on demand and returns a compact summary.
|
|
148
99
|
|
|
149
100
|
## Limitations
|
|
150
101
|
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
- `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
|