pi-btw 0.1.1 → 0.2.1

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
@@ -2,16 +2,18 @@
2
2
 
3
3
  A small [pi](https://github.com/badlogic/pi-mono) extension that adds a `/btw` side conversation channel.
4
4
 
5
- `/btw` runs immediately, even while the main agent is still busy.
5
+ `/btw` opens a real pi sub-session with coding-tool access, and it runs immediately even while the main agent is still busy.
6
6
 
7
7
  ![BTW overlay example](docs/btw-overlay.png)
8
8
 
9
9
  ## What it does
10
10
 
11
11
  - opens a parallel side conversation without interrupting the main run
12
+ - runs that side conversation as a real pi sub-session with `read` / `bash` / `edit` / `write` tool access
12
13
  - keeps a continuous BTW thread by default
13
14
  - supports `/btw:tangent` for a contextless side thread that does not inherit the current main-session conversation
14
- - streams answers into a widget above the editor
15
+ - 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+/`
15
17
  - keeps BTW thread entries out of the main agent's future context
16
18
  - lets you inject the full thread, or a summary of it, back into the main agent
17
19
  - optionally saves an individual BTW exchange as a visible session note with `--save`
@@ -61,28 +63,38 @@ pi install /absolute/path/to/pi-btw
61
63
 
62
64
  - runs right away
63
65
  - works while pi is busy
66
+ - creates or reuses a real BTW sub-session instead of a one-off completion call
64
67
  - continues the current BTW thread
65
- - streams into a widget above the editor
68
+ - opens or refreshes the focused BTW modal shell
69
+ - streams into the BTW modal transcript/status surface
66
70
  - persists the BTW exchange as hidden thread state
67
71
  - with `--save`, also saves that single exchange as a visible session note
68
72
 
73
+ ## Overlay controls
74
+
75
+ - `Alt+/` toggles focus between BTW and the main editor without closing the overlay
76
+ - `Ctrl+Alt+W` is a fallback focus toggle for terminals that do not deliver `Alt+/` as a usable shortcut
77
+ - `Esc` still dismisses BTW immediately while the overlay is focused
78
+ - BTW now opens top-centered so the main session remains visible underneath it
79
+
69
80
  ### `/btw:new [question]`
70
81
 
71
82
  - clears the current BTW thread
72
83
  - starts a fresh thread that still inherits the current main-session context
73
84
  - optionally asks the first question in the new thread immediately
85
+ - if no question is provided, opens a fresh BTW modal ready for the next prompt
74
86
 
75
87
  ### `/btw:tangent [--save] <question>`
76
88
 
77
89
  - starts or continues a contextless tangent thread
78
90
  - does not inherit the current main-session conversation
79
91
  - if you switch from `/btw` to `/btw:tangent` (or back), the previous side thread is cleared so the modes do not mix
80
- - streams into the same above-editor widget
92
+ - opens or refreshes the same focused BTW modal shell
81
93
  - with `--save`, also saves that single exchange as a visible session note
82
94
 
83
95
  ### `/btw:clear`
84
96
 
85
- - dismisses the BTW widget
97
+ - dismisses the BTW modal/widget
86
98
  - clears the current BTW thread
87
99
 
88
100
  ### `/btw:inject [instructions]`
@@ -100,12 +112,34 @@ pi install /absolute/path/to/pi-btw
100
112
 
101
113
  ## Behavior
102
114
 
115
+ ### Real sub-session model
116
+
117
+ BTW is implemented as an actual pi sub-session with its own in-memory session state, transcript events, and tool surface.
118
+
119
+ - contextual `/btw` threads seed that sub-session from the current main-session branch while filtering out BTW-visible notes from the parent context
120
+ - `/btw:tangent` starts the same BTW UI in a contextless mode with no inherited main-session conversation
121
+ - 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
122
+ - handoff commands (`/btw:inject` and `/btw:summarize`) read from the BTW sub-session thread rather than maintaining a separate manual transcript model
123
+
124
+ ### In-modal slash behavior
125
+
126
+ Inside the BTW modal composer, slash handling is split at the BTW/session boundary:
127
+
128
+ - `/btw:new`, `/btw:tangent`, `/btw:clear`, `/btw:inject`, and `/btw:summarize` stay owned by BTW because they control BTW lifecycle or handoff behavior
129
+ - any other slash-prefixed input is routed through the BTW sub-session's normal `prompt()` path
130
+ - this means ordinary pi slash commands like `/help` are handled by the sub-session instead of being rejected by a modal-only fallback
131
+ - 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
132
+
133
+ This keeps BTW-owned lifecycle commands explicit while giving the side conversation the same slash-command surface as the underlying sub-session.
134
+
135
+ ## Behavior
136
+
103
137
  ### Hidden BTW thread state
104
138
 
105
139
  BTW exchanges are persisted in the session as hidden custom entries so they:
106
140
 
107
141
  - survive reloads and restarts
108
- - rehydrate the BTW widget for the current branch
142
+ - rehydrate the BTW modal shell for the current branch
109
143
  - preserve whether the current side thread is a normal `/btw` thread or a contextless `/btw:tangent`
110
144
  - stay out of the main agent's LLM context
111
145
 
Binary file