@narumitw/pi-btw 0.42.1 β 0.43.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 +45 -24
- package/package.json +1 -1
- package/src/btw.ts +196 -159
- package/src/menu.ts +256 -0
- package/src/settings.ts +237 -0
- package/src/text.ts +10 -0
- package/src/transcript-pager.ts +88 -11
package/README.md
CHANGED
|
@@ -8,13 +8,14 @@ Use it when you want to ask a temporary question, inspect context, or get a shor
|
|
|
8
8
|
|
|
9
9
|
## β¨ Features
|
|
10
10
|
|
|
11
|
-
- Adds a `/btw`
|
|
11
|
+
- Adds a `/btw` menu for starting a side thread or changing pi-btw settings.
|
|
12
|
+
- Keeps `/btw <question>` as a direct fast path.
|
|
12
13
|
- Answers side questions in a temporary, scrollable UI.
|
|
13
14
|
- Supports follow-up questions in the same ephemeral side thread.
|
|
14
15
|
- Optionally brings the latest answer, a question-to-end suffix, an exact line range, or the entire side thread into the main editor.
|
|
15
16
|
- Uses the current session branch as context.
|
|
16
17
|
- Uses Pi's current model or an independent model selected in `pi-btw.json`.
|
|
17
|
-
-
|
|
18
|
+
- Uses a pi-btw thinking level that can be changed with Pi's configured thinking shortcut and remembered for next time.
|
|
18
19
|
- Does not append the side question or answer to the main conversation.
|
|
19
20
|
- Works as an independently installable npm Pi extension package.
|
|
20
21
|
|
|
@@ -38,7 +39,7 @@ pi -e ./extensions/pi-btw
|
|
|
38
39
|
|
|
39
40
|
## π Usage
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
Open the pi-btw menu or provide the first question immediately:
|
|
42
43
|
|
|
43
44
|
```text
|
|
44
45
|
/btw
|
|
@@ -54,16 +55,23 @@ Examples:
|
|
|
54
55
|
/btw is this API name idiomatic?
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
Running `/btw` alone opens
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
Running `/btw` alone opens a two-row menu. **Start side thread** is selected first, so pressing
|
|
59
|
+
`Enter` opens an empty ephemeral side thread; **Settings** changes the starting thinking level
|
|
60
|
+
and whether shortcut changes are remembered. `/btw <question>` bypasses this menu, and its answer
|
|
61
|
+
opens above the side-thread editor. A compact `btw Β· side thread` header stays fixed above the
|
|
62
|
+
content so the ephemeral workspace remains recognizable while scrolling. Messages use Pi's normal
|
|
63
|
+
user and assistant presentation without numbered turns or role labels. Type each question and press
|
|
64
|
+
`Enter`; no follow-up shortcut is required.
|
|
63
65
|
Previous side questions and answers remain available to the model and visible for that
|
|
64
|
-
invocation.
|
|
65
|
-
`
|
|
66
|
-
|
|
66
|
+
invocation. The side-thread header shows its current thinking level. Press Pi's configured
|
|
67
|
+
`app.thinking.cycle` shortcut (`Shift+Tab` by default) in the composer to cycle the levels
|
|
68
|
+
supported by the side-thread model; every later question uses the displayed level until it is
|
|
69
|
+
changed again. By default, each shortcut change is also written to `pi-btw.json` for the next
|
|
70
|
+
invocation. Turn **Remember thinking level changes** off in Settings to keep changes local to the
|
|
71
|
+
current side thread. Neither path changes the main session's thinking level. While a response is
|
|
72
|
+
running, the transcript stays visible above a compact `Answeringβ¦` status.
|
|
73
|
+
The footer shows `PgUp`/`PgDn` only when history can scroll; press `Ctrl+C` to cancel an
|
|
74
|
+
in-progress answer or leave the side thread.
|
|
67
75
|
|
|
68
76
|
After at least one successful answer, press `Ctrl+R` to bring selected context to the main
|
|
69
77
|
editor. The scope menu shows the size of the latest question and answer and the entire side
|
|
@@ -106,7 +114,8 @@ setting; pi-btw does not add any environment variables.
|
|
|
106
114
|
```json
|
|
107
115
|
{
|
|
108
116
|
"model": "anthropic/claude-sonnet-4-5",
|
|
109
|
-
"thinkingLevel": "low"
|
|
117
|
+
"thinkingLevel": "low",
|
|
118
|
+
"rememberThinkingLevelChanges": true
|
|
110
119
|
}
|
|
111
120
|
```
|
|
112
121
|
|
|
@@ -117,17 +126,26 @@ cannot be found or authenticated, pi-btw warns and falls back to the current ses
|
|
|
117
126
|
If neither model is available, `/btw` reports an error and stops. This selection affects only
|
|
118
127
|
`/btw`; it does not change the main session model.
|
|
119
128
|
|
|
120
|
-
Pi calls its reasoning setting the **thinking level**.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
Pi calls its reasoning setting the **thinking level**. `thinkingLevel` sets pi-btw's starting
|
|
130
|
+
level; accepted values are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. When the
|
|
131
|
+
field is absent for backward compatibility, the next invocation starts from the current session
|
|
132
|
+
level. The initial value and shortcut cycle are clamped to the selected side model's capabilities
|
|
133
|
+
using Pi's model rules. Pi-btw does not read, write, or change the main session's
|
|
134
|
+
`defaultThinkingLevel`.
|
|
135
|
+
|
|
136
|
+
`rememberThinkingLevelChanges` controls only persistence and defaults to `true` when omitted. A
|
|
137
|
+
side-thread shortcut always changes that side thread immediately. When remembering is on, the
|
|
138
|
+
concrete level is written for the next invocation; when off, `pi-btw.json` stays unchanged. If a
|
|
139
|
+
shortcut write fails, the local change remains active and pi-btw warns that it was not remembered.
|
|
140
|
+
A failed Settings-screen save instead restores the previous displayed value.
|
|
141
|
+
|
|
142
|
+
A missing settings file is a side-effect-free read: pi-btw creates it only after a Settings change
|
|
143
|
+
or a remembered shortcut change. Saves are ordered within the Pi process and published atomically
|
|
144
|
+
with a same-directory temporary file and rename. They preserve `model` and unknown fields; malformed
|
|
145
|
+
or invalid files block saves and remain unchanged. Settings must be valid UTF-8 and no larger than
|
|
146
|
+
64 KiB, so unexpectedly large or invalidly encoded files are rejected without being rewritten.
|
|
147
|
+
Separate Pi processes and external editors are outside this in-process ordering boundary. The file
|
|
148
|
+
is read for each `/btw` invocation, so edits apply without `/reload`.
|
|
131
149
|
|
|
132
150
|
## π§ Why use pi-btw?
|
|
133
151
|
|
|
@@ -141,7 +159,10 @@ extensions/pi-btw/
|
|
|
141
159
|
β βββ index.ts
|
|
142
160
|
β βββ btw.ts
|
|
143
161
|
β βββ bring-to-main.ts
|
|
162
|
+
β βββ menu.ts
|
|
163
|
+
β βββ settings.ts
|
|
144
164
|
β βββ side-thread.ts
|
|
165
|
+
β βββ text.ts
|
|
145
166
|
β βββ transcript-pager.ts
|
|
146
167
|
βββ README.md
|
|
147
168
|
βββ LICENSE
|