@narumitw/pi-btw 0.63.2 → 0.63.4

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/CHANGELOG.md ADDED
@@ -0,0 +1,259 @@
1
+ # @narumitw/pi-btw
2
+
3
+ ## 0.63.4
4
+
5
+ ### Patch Changes
6
+
7
+ - e484010: Include the existing package-root CHANGELOG.md in extension tarballs so Pi can show native update notices. Keep Changesets version headings and Pi's first-observation and collapseChangelog behavior unchanged.
8
+ - Updated dependencies [54f2700]
9
+ - Updated dependencies [6c76ef1]
10
+ - @narumitw/pi-tui-kit@0.69.0
11
+
12
+ ## 0.63.3
13
+
14
+ ### Patch Changes
15
+
16
+ - bab4b67: Allow main-pane submissions while a split workspace remains open, including when BTW starts while the main agent is idle. Keep the complete workspace task session-owned, prevent overlapping BTW flows, and preserve cancellation, shutdown draining, and error reporting.
17
+
18
+ ## 0.63.2
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [a21d39b]
23
+ - Updated dependencies [f68aa54]
24
+ - Updated dependencies [b062d21]
25
+ - @narumitw/pi-tui-kit@0.68.0
26
+
27
+ ## 0.63.1
28
+
29
+ ### Patch Changes
30
+
31
+ - 57eeae7: Add the opt-in `createFullscreenHandoff()` resource and native test harness. Share terminal entry/exit drain, cancellation-safe restoration, keyboard-protocol recovery, owned overlay handling, and cleanup errors through public Pi TUI APIs. Keep ordinary Kit interactions unchanged.
32
+
33
+ Use the resource in Starship's configuration chat and BTW's multi-screen workspace. Keep each extension's input policy, layouts, domain state, permissions, and persistence local. BTW now waits for native input drain before entry. Changesets raises both consumer floors to the Kit API release; dependent publication requires its exact registry artifact.
34
+ - Updated dependencies [57eeae7]
35
+ - @narumitw/pi-tui-kit@0.67.0
36
+
37
+ ## 0.63.0
38
+
39
+ ### Minor Changes
40
+
41
+ - ec9e092: Add manual preview and import of new main-thread context into retained side threads. Keep imported updates in conversation order, preserve earlier request prefixes, and reject incompatible branch or context-boundary changes. Add a configurable import shortcut with F9–F11 fallbacks.
42
+
43
+ ## 0.62.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 7d15a96: Align the BTW workspace with native Pi input, prompt navigation, scrollbars, and cursor-first dock layout. Add a conflict-checked keyboard shortcut to switch panes. Keep effective key hints, native mouse editing, draft safeguards, and queue timing clear. Cancel and drain session-owned work on replacement and shutdown, and contain renderer cleanup and clipboard failures.
48
+
49
+ ### Patch Changes
50
+
51
+ - d60fa4e: Bring the BTW conversation appearance closer to native Pi. Move side identity, model, thinking, focus, and concise key hints below the editor; match native working borders and message spacing while retaining cursor-first short layouts. Keep tools absent and preserve existing input, queue, lifecycle, and draft-safety behavior.
52
+ - Updated dependencies [077137a]
53
+ - Updated dependencies [9f80b89]
54
+ - Updated dependencies [efc474c]
55
+ - @narumitw/pi-tui-kit@0.66.0
56
+
57
+ ## 0.61.2
58
+
59
+ ### Patch Changes
60
+
61
+ - 033dead: Reject unknown and duplicate modifiers when selecting the fullscreen jump-to-latest key hint. Match Pi's strict key parser so the hint names a usable binding.
62
+
63
+ ## 0.61.1
64
+
65
+ ### Patch Changes
66
+
67
+ - c073bc0: Fix the main-thread tree picker on Pi 0.87 sessions containing context edits.
68
+ - 81be3f7: Send a per-thread routing `sessionId` with side requests so provider overrides that require one, such as subscription attribution transports, no longer reject `/btw`; the main session ID is still used only for OpenCode headers.
69
+
70
+ ## 0.61.0
71
+
72
+ ### Minor Changes
73
+
74
+ - 865f1d3: Make the split-pane divider draggable and remember the side-thread width.
75
+ - 129f324: Add configurable fullscreen, side-thread-left, and side-thread-right workspaces with Pi's live main-thread view and click-to-focus input.
76
+
77
+ ### Patch Changes
78
+
79
+ - 2bacc07: Use one muted column for the split-pane divider.
80
+
81
+ ## 0.60.3
82
+
83
+ ### Patch Changes
84
+
85
+ - 34b57b2: Route side-thread requests through Pi's authenticated `modelRegistry.streamSimple()` path so extension-registered providers, OAuth endpoint overrides, headers, and environment credentials are resolved by Pi at request time.
86
+
87
+ ## 0.60.2
88
+
89
+ ### Patch Changes
90
+
91
+ - 8abd5b7: Keep generated extension runtime graphs inside Pi's Jiti-loaded TypeScript path to avoid duplicate peer-runtime evaluation during startup. Add measured generated runtimes for Context Management, Herdr, and TypeSafe Search.
92
+
93
+ ## 0.60.1
94
+
95
+ ### Patch Changes
96
+
97
+ - 67a3049: Adapt provider, transcript, usage, deferred-tool, and telemetry behavior to Pi's current runtime contracts, including accurate cache-warming accounting and exclusion from ordinary generation traces.
98
+
99
+ ## 0.60.0
100
+
101
+ ### Minor Changes
102
+
103
+ - c4d403b: Add a searchable model picker to `/btw` Settings with scoped available models, same as the main thread reset, and model-aware thinking choices.
104
+
105
+ ## 0.59.0
106
+
107
+ ### Minor Changes
108
+
109
+ - 022ba82: Render supported Mermaid fences as width-safe, themed Unicode diagrams in side-thread transcripts, with readable source fallbacks for malformed, unsupported, or oversized diagrams.
110
+
111
+ ### Patch Changes
112
+
113
+ - ddaccd2: Complete `/btw` fullscreen cancellation by forwarding upstream aborts, closing mounted composers, restoring the parent TUI, and stopping lazy Mermaid transcript preparation when cancelled.
114
+
115
+ ## 0.58.1
116
+
117
+ ### Patch Changes
118
+
119
+ - ad0fbc0: Honor the API base URL returned by Pi's authentication resolver for both inherited and explicitly configured side-thread models. This fixes misdirected requests for GitHub Copilot accounts that use a different endpoint from the provider default, without changing the main session's model.
120
+
121
+ ## 0.58.0
122
+
123
+ ### Minor Changes
124
+
125
+ - 609f6a8: Add BTW-only exit, thinking-cycle, and bring-to-main keybindings in `/btw` → Settings, with conflict validation and per-action reset. Preserve Ctrl+C as hard cancel and keep pasted input out of shortcut handling.
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [317f7bd]
130
+ - @narumitw/pi-tui-kit@0.61.0
131
+
132
+ ## 0.57.1
133
+
134
+ ### Patch Changes
135
+
136
+ - ee07eb8: Forward Pi session headers to OpenCode providers for side-thread requests.
137
+
138
+ ## 0.57.0
139
+
140
+ ### Minor Changes
141
+
142
+ - f24a5b0: Add a themed, clickable Jump to latest control that honors Pi's effective fullscreen bottom keybinding.
143
+
144
+ ## 0.56.2
145
+
146
+ ### Patch Changes
147
+
148
+ - c0fe03e: Wait for Pi's terminal input drain before restoring the parent fullscreen TUI after Ctrl+C.
149
+
150
+ ## 0.56.1
151
+
152
+ ### Patch Changes
153
+
154
+ - 612df75: Defer Ctrl+C terminal restoration until input dispatch finishes so Windows fullscreen sessions redraw and scroll correctly.
155
+
156
+ ## 0.56.0
157
+
158
+ ### Minor Changes
159
+
160
+ - f41734c: Add configurable manual fullscreen selection copying through Pi's effective copy keybinding, with paste-safe input and compatibility checks.
161
+
162
+ ## 0.55.4
163
+
164
+ ### Patch Changes
165
+
166
+ - Updated dependencies [40182e5]
167
+ - @narumitw/pi-tui-kit@0.59.0
168
+
169
+ ## 0.55.3
170
+
171
+ ### Patch Changes
172
+
173
+ - 4fb170b: Restore main-editor input immediately after Ctrl+C exits a dedicated side thread.
174
+ - 2250f3c: Close the active side flow when Ctrl+C restores the main editor while transcript search has focus.
175
+ - Updated dependencies [78276b0]
176
+ - Updated dependencies [dc9802e]
177
+ - @narumitw/pi-tui-kit@0.58.1
178
+
179
+ ## 0.55.2
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [b9eba3a]
184
+ - @narumitw/pi-tui-kit@0.58.0
185
+
186
+ ## 0.55.1
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies [6574232]
191
+ - Updated dependencies [cddc265]
192
+ - @narumitw/pi-tui-kit@0.57.0
193
+
194
+ ## 0.55.0
195
+
196
+ ### Minor Changes
197
+
198
+ - 79bc155: Add themed fullscreen transcript search and verified host clipboard feedback for mouse selections.
199
+
200
+ ## 0.54.2
201
+
202
+ ### Patch Changes
203
+
204
+ - 30bc076: Load each extension from a generated TypeScript runtime to reduce Jiti package startup work while preserving existing first-use boundaries.
205
+
206
+ ## 0.54.1
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [8bead31]
211
+ - @narumitw/pi-tui-kit@0.56.0
212
+
213
+ ## 0.54.0
214
+
215
+ ### Minor Changes
216
+
217
+ - b5c0682: Add native mouse-wheel and trackpad scrolling to side-thread transcript history.
218
+
219
+ ## 0.53.0
220
+
221
+ ### Minor Changes
222
+
223
+ - d97edfd: Add a native main-session tree picker that starts a fresh side thread from any selected branch without switching the main conversation.
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [3176172]
228
+ - @narumitw/pi-tui-kit@0.55.0
229
+
230
+ ## 0.52.0
231
+
232
+ ### Minor Changes
233
+
234
+ - f3d76af: Add a Same as main thread thinking option that starts new side threads from the current main thread level while keeping shortcut changes local.
235
+
236
+ ## 0.51.0
237
+
238
+ ### Minor Changes
239
+
240
+ - 69e8485: Add local fuzzy search to the in-memory Resume thread choice.
241
+
242
+ ## 0.50.0
243
+
244
+ ### Minor Changes
245
+
246
+ - be8d492: Add an in-memory Resume picker to `/btw` so the current Pi session can continue any non-empty side thread by its first question while `/btw <question>` remains a fresh-thread fast path.
247
+
248
+ ## 0.49.7
249
+
250
+ ### Patch Changes
251
+
252
+ - 3f33860: Run side threads in a dedicated full-screen TUI so mouse-drag copying stays stable while the main agent continues producing output in the background.
253
+ - 2a2c9c1: Queue Pi-style steering questions while a side-thread answer is running, process them one at a time without touching the main conversation, and report malformed side-model responses without hanging the side UI.
254
+
255
+ ## 0.49.6
256
+
257
+ ### Patch Changes
258
+
259
+ - a4b44ee: Route side-question completions through Pi's effective runtime provider so custom provider APIs work.
package/README.md CHANGED
@@ -54,6 +54,7 @@ The side thread stays separate until you explicitly bring context to the main ed
54
54
  | `/btw <question>` | Start a new side thread immediately with the supplied question. |
55
55
 
56
56
  Both routes require TUI mode and a model with usable credentials; see [Settings](#-settings).
57
+ Only one BTW flow can be open per session; close it before running `/btw` again.
57
58
  Side questions and selected conversation context are sent to that model's provider.
58
59
  Bringing context back fills the main editor without submitting; replacing an existing draft requires confirmation.
59
60
  Ctrl+C cancels the response and discards the current draft and queued questions, but completed exchanges remain resumable in memory.
@@ -122,7 +123,8 @@ Accepted values are `fullscreen`, `left-pane`, and `right-pane`.
122
123
  The pane names identify the side thread's position; the other pane reuses Pi's native main-thread rendering at pane width and stays current while BTW is open.
123
124
  A single muted divider separates the panes; click either pane or use the pane-switch shortcut to move keyboard focus.
124
125
  The footer below the editor shows **BTW focus** or **Main focus** and the available switch key.
125
- It also shows the selected side model and thinking level when space permits; narrow or short views omit optional fields and hints before the active input row.
126
+ Main-focus submissions use Pi's normal submission and steering behavior without closing BTW, including when the workspace opens while the main agent is idle.
127
+ The footer also shows the selected side model and thinking level when space permits; narrow or short views omit optional fields and hints before the active input row.
126
128
  Drag the divider with the primary mouse button to resize both panes.
127
129
  The side-thread share is limited to 20–80% and saved as `sidePaneRatio` when the button is released, independent of whether the side thread is on the left or right.
128
130
  If the save fails, the workspace restores the last saved ratio and reports the error.
package/dist/index.ts CHANGED
@@ -2037,6 +2037,7 @@ var BtwFullscreenHost = class {
2037
2037
  removeHardCancelListener;
2038
2038
  removeUpstreamAbortListener;
2039
2039
  started = false;
2040
+ splitReady = false;
2040
2041
  disposed = false;
2041
2042
  finished = false;
2042
2043
  parentRestorePromise;
@@ -2458,6 +2459,10 @@ var BtwFullscreenHost = class {
2458
2459
  }
2459
2460
  fullscreen.setFocus(component);
2460
2461
  fullscreen.requestRender();
2462
+ if (splitPane && !this.splitReady && !this.disposed && !this.finished && !this.lifetimeController.signal.aborted) {
2463
+ this.splitReady = true;
2464
+ this.options.onSplitReady?.();
2465
+ }
2461
2466
  }
2462
2467
  }).catch(fail);
2463
2468
  });
@@ -4638,6 +4643,7 @@ function btw(pi, dependencies = {}) {
4638
4643
  const subscribeMainThreadUpdates = registerBtwMainThreadUpdates(pi);
4639
4644
  const getLifetime = registerBtwSessionLifetimes(pi);
4640
4645
  const sessionThreads = /* @__PURE__ */ new WeakMap();
4646
+ const activeCommands = /* @__PURE__ */ new WeakSet();
4641
4647
  let nextThreadNumber = 1;
4642
4648
  const listResumeThreads = (resumableThreads) => [...resumableThreads.values()].reverse().filter((state) => state.thread.turns.length > 0 && state.title || state.thread.updates.length > 0).sort((first, second) => second.updatedAt - first.updatedAt || second.createdAt - first.createdAt).map((state) => ({
4643
4649
  id: state.id,
@@ -4651,14 +4657,28 @@ function btw(pi, dependencies = {}) {
4651
4657
  if (lifetime.signal.aborted) return Promise.resolve();
4652
4658
  const commandCtx = Object.create(ctx);
4653
4659
  Object.defineProperty(commandCtx, "signal", { value: lifetime.signal, configurable: true });
4654
- return lifetime.track(
4655
- handleCommand(args, commandCtx, lifetime).catch((error) => {
4656
- if (!lifetime.signal.aborted) throw error;
4657
- })
4660
+ if (activeCommands.has(lifetime)) {
4661
+ notifySafely3(commandCtx, "A /btw workspace is already open; close it before opening another.", "warning");
4662
+ return Promise.resolve();
4663
+ }
4664
+ activeCommands.add(lifetime);
4665
+ const ready = Promise.withResolvers();
4666
+ let released = false;
4667
+ const task = lifetime.track(
4668
+ handleCommand(args, commandCtx, lifetime, () => {
4669
+ if (lifetime.signal.aborted) return;
4670
+ released = true;
4671
+ ready.resolve();
4672
+ }).catch((error) => {
4673
+ if (lifetime.signal.aborted) return;
4674
+ if (!released) throw error;
4675
+ notifySafely3(commandCtx, `Pi BTW: ${formatError6(error)}`, "error");
4676
+ }).finally(() => activeCommands.delete(lifetime))
4658
4677
  );
4678
+ return Promise.race([task, ready.promise]);
4659
4679
  }
4660
4680
  });
4661
- async function handleCommand(args, ctx, lifetime) {
4681
+ async function handleCommand(args, ctx, lifetime, releaseMainInput) {
4662
4682
  let resumableThreads = sessionThreads.get(lifetime);
4663
4683
  if (!resumableThreads) {
4664
4684
  resumableThreads = /* @__PURE__ */ new Map();
@@ -4749,6 +4769,7 @@ function btw(pi, dependencies = {}) {
4749
4769
  canRestoreParent: lifetime.canRestoreParent,
4750
4770
  copyOnSelect: effectiveFullscreenCopyOnSelect(settings),
4751
4771
  layout: effectiveBtwLayout(settings),
4772
+ ...effectiveBtwLayout(settings) !== "fullscreen" ? { onSplitReady: releaseMainInput } : {},
4752
4773
  sidePaneRatio: effectiveBtwSidePaneRatio(settings),
4753
4774
  persistSidePaneRatio: (ratio, signal) => updateBtwSettings({ sidePaneRatio: ratio }, { signal }).then(() => void 0),
4754
4775
  subscribeMainThreadUpdates: (listener) => subscribeMainThreadUpdates(ctx.sessionManager, listener),