pi-btw 0.4.1 → 0.6.0

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 CHANGED
@@ -11,9 +11,11 @@ A small [pi](https://github.com/earendil-works/pi-mono) extension that adds a `/
11
11
  - opens a parallel side conversation without interrupting the main run
12
12
  - runs that side conversation as a real pi sub-session with `read` / `bash` / `edit` / `write` tool access
13
13
  - keeps a continuous BTW thread by default
14
+ - accepts `/side` as an alias for the `/btw` entry command
14
15
  - supports `/btw:tangent` for a contextless side thread that does not inherit the current main-session conversation
16
+ - supports `/btw:ask` for a read-only side thread that inherits main-session context but exposes only `read` / `grep` / `find` / `ls`
15
17
  - opens a focused BTW modal shell with its own composer and transcript
16
- - keeps the BTW overlay open while you switch focus back to the main editor with `Alt+/`
18
+ - keeps the BTW overlay open while you switch focus back to the main editor with `Alt+/`, `Super+/`, or `Ctrl+Alt+W` (all remappable)
17
19
  - keeps BTW thread entries out of the main agent's future context
18
20
  - supports BTW-only model and thinking overrides without changing the main thread settings
19
21
  - lets you inject the full thread, or a summary of it, back into the main agent
@@ -21,6 +23,8 @@ A small [pi](https://github.com/earendil-works/pi-mono) extension that adds a `/
21
23
 
22
24
  ## Install
23
25
 
26
+ pi-btw requires Pi 0.85.1 or newer.
27
+
24
28
  ### From npm (after publish)
25
29
 
26
30
  ```bash
@@ -49,10 +53,13 @@ pi install /absolute/path/to/pi-btw
49
53
 
50
54
  ```text
51
55
  /btw what file defines this route?
56
+ /side what file defines this route?
52
57
  /btw how would you refactor this parser?
53
58
  /btw --save summarize the last error in one sentence
54
59
  /btw:new let's start a fresh thread about auth
55
60
  /btw:tangent brainstorm from first principles without using the current chat context
61
+ /btw:ask what does this module do?
62
+ /btw:ask --save explain the latest test failure
56
63
  /btw:model openai gpt-5-mini openai-responses
57
64
  /btw:thinking low
58
65
  /btw:inject implement the plan we just discussed
@@ -70,14 +77,30 @@ pi install /absolute/path/to/pi-btw
70
77
  - continues the current BTW thread
71
78
  - opens or refreshes the focused BTW modal shell
72
79
  - streams into the BTW modal transcript/status surface
80
+ - on RPC/SDK hosts, displays completed inline-question responses as visible session notes instead
81
+ - composer-only `/btw` requires the TUI; pass the question inline on RPC/SDK hosts
73
82
  - persists the BTW exchange as hidden thread state
74
83
  - with `--save`, also saves that single exchange as a visible session note
75
84
 
85
+ ### `/side [--save] <question>`
86
+
87
+ - alias for `/btw`, matching the equivalent command in Codex
88
+ - shares the same thread, overlay, persistence, model, and thinking settings as `/btw`
89
+ - `/btw` stays canonical; lifecycle commands remain under the `/btw:*` namespace, so there is no `/side:new` or `/side:clear`
90
+
76
91
  ## Overlay controls
77
92
 
78
- - `Alt+/` toggles focus between BTW and the main editor without closing the overlay
79
- - `Ctrl+Alt+W` is a fallback focus toggle for terminals that do not deliver `Alt+/` as a usable shortcut
80
- - `Esc` still dismisses BTW immediately while the overlay is focused
93
+ - `Alt+w` toggles the overlay between the framed window layout (inset from the terminal edges) and a full-width layout
94
+ - full-width mode makes terminal Shift+drag selection capture only the dialog's own text, which is handy for copying without pulling in surrounding main-screen content
95
+ - window mode keeps the full box frame; full-width mode drops the side borders and corner glyphs (keeping only horizontal rules) so those border columns never land inside a drag selection
96
+ - `Alt+/`, `Super+/`, or `Ctrl+Alt+W` toggles focus between BTW and the main editor without closing the overlay
97
+ - `Super+/` requires a terminal that reports the Super modifier, typically through the Kitty keyboard protocol
98
+ - `Ctrl+Alt+W` remains a fallback for terminals that do not deliver either primary shortcut
99
+ - set the `PI_BTW_FOCUS_KEYS` environment variable to remap these when they conflict with your window manager or terminal
100
+ - the value is a comma-separated list of pi-tui key identifiers such as `PI_BTW_FOCUS_KEYS="ctrl+/,ctrl+alt+b"`; it replaces the defaults entirely
101
+ - identifiers combine `ctrl`, `shift`, `alt`, and `super` with a single base key (letter, digit, symbol, or named key like `enter`/`f5`); blank or invalid entries are ignored, and the defaults are kept if none are usable
102
+ - while BTW is streaming, the first `Esc` aborts the request and keeps its partial transcript visible; press `Esc` again to dismiss
103
+ - while BTW is idle, `Esc` dismisses the overlay immediately
81
104
  - BTW now opens top-centered so the main session remains visible underneath it
82
105
 
83
106
  ### `/btw:new [question]`
@@ -95,6 +118,17 @@ pi install /absolute/path/to/pi-btw
95
118
  - opens or refreshes the same focused BTW modal shell
96
119
  - with `--save`, also saves that single exchange as a visible session note
97
120
 
121
+ ### `/btw:ask [--save] <question>`
122
+
123
+ - starts or continues an enforced read-only side thread
124
+ - inherits the current main-session conversation, exactly like `/btw`
125
+ - exposes only pi's built-in read-only tools (`read`, `grep`, `find`, `ls`); `bash`, `edit`, and `write` are never available to it
126
+ - follows up read-only for the lifetime of the thread
127
+ - identifies the thread as read-only in the overlay title
128
+ - if you switch between `/btw`, `/btw:tangent`, and `/btw:ask`, the previous side thread is cleared and the child session is recreated so the capability boundary stays unambiguous
129
+ - opens or refreshes the same focused BTW modal shell
130
+ - with `--save`, also saves that single exchange as a visible session note
131
+
98
132
  ### `/btw:clear`
99
133
 
100
134
  - dismisses the BTW modal/widget
@@ -136,6 +170,7 @@ BTW is implemented as an actual pi sub-session with its own in-memory session st
136
170
 
137
171
  - contextual `/btw` threads seed that sub-session from the current main-session branch while filtering out BTW-visible notes from the parent context
138
172
  - `/btw:tangent` starts the same BTW UI in a contextless mode with no inherited main-session conversation
173
+ - `/btw:ask` seeds the same main-session context as `/btw` but restricts the child session's tool surface to pi's read-only tools, so the boundary is structural rather than prompt-based
139
174
  - BTW can inherit the main thread model/thinking settings or use BTW-only overrides via `/btw:model` and `/btw:thinking`
140
175
  - `/btw:summarize` uses the current effective BTW model but keeps thinking off
141
176
  - the overlay transcript/status line is driven from sub-session events, so tool activity, streaming deltas, failures, and recovery are all visible without scraping rendered output
@@ -145,7 +180,7 @@ BTW is implemented as an actual pi sub-session with its own in-memory session st
145
180
 
146
181
  Inside the BTW modal composer, slash handling is split at the BTW/session boundary:
147
182
 
148
- - `/btw:new`, `/btw:tangent`, `/btw:clear`, `/btw:model`, `/btw:thinking`, `/btw:inject`, and `/btw:summarize` stay owned by BTW because they control BTW lifecycle, configuration, or handoff behavior
183
+ - `/btw:new`, `/btw:tangent`, `/btw:ask`, `/btw:clear`, `/btw:model`, `/btw:thinking`, `/btw:inject`, and `/btw:summarize` stay owned by BTW because they control BTW lifecycle, configuration, or handoff behavior
149
184
  - any other slash-prefixed input is routed through the BTW sub-session's normal `prompt()` path
150
185
  - this means ordinary pi slash commands like `/help` are handled by the sub-session instead of being rejected by a modal-only fallback
151
186
  - if the sub-session cannot handle a slash command, BTW surfaces the real sub-session failure through the transcript/status state instead of inventing an "unsupported slash input" warning
@@ -160,7 +195,7 @@ BTW exchanges are persisted in the session as hidden custom entries so they:
160
195
 
161
196
  - survive reloads and restarts
162
197
  - rehydrate the BTW modal shell for the current branch
163
- - preserve whether the current side thread is a normal `/btw` thread or a contextless `/btw:tangent`
198
+ - preserve whether the current side thread is a normal `/btw` thread, a contextless `/btw:tangent`, or a read-only `/btw:ask` thread
164
199
  - preserve the current BTW-only model and thinking overrides for that session history
165
200
  - stay out of the main agent's LLM context
166
201
 
@@ -198,6 +233,27 @@ To use it without installing:
198
233
  pi -e /path/to/pi-btw
199
234
  ```
200
235
 
236
+ ## DeepSeek Harness
237
+
238
+ pi-btw also runs unmodified on [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) through the [pi2dsh](https://github.com/weijiafu14/pi2dsh) compatibility bridge.
239
+
240
+ For DSH Web, install the **dsh-work-x** suite, which includes pi-btw, pi2dsh, a browser side-chat window, and other extensions:
241
+
242
+ ```bash
243
+ dsh plugin --profile web add dsh-work-x
244
+ ```
245
+
246
+ To install just the bridge and this extension instead:
247
+
248
+ ```bash
249
+ dsh plugin --profile web add pi2dsh
250
+ dsh plugin --profile web add pi-btw
251
+ ```
252
+
253
+ Restart DSH after installation, then use `/btw <question>` to start a side conversation. The suite presents it in a browser side-chat window backed by a native DSH child session. DSH uses hyphens for the command family: for example, `/btw:inject` becomes `/btw-inject`.
254
+
255
+ See the [DSH side-conversation guide](https://github.com/weijiafu14/pi2dsh/tree/main/examples/side-conversation) for CLI-only installation, usage, and screenshots, and the [versioned validation results](https://github.com/weijiafu14/pi2dsh/tree/main/community/release-0.25.1) for the tested releases. Report DSH integration problems to [pi2dsh](https://github.com/weijiafu14/pi2dsh/issues).
256
+
201
257
  ## License
202
258
 
203
259
  MIT