pi-btw 0.1.1 → 0.2.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
@@ -2,16 +2,17 @@
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
15
16
  - keeps BTW thread entries out of the main agent's future context
16
17
  - lets you inject the full thread, or a summary of it, back into the main agent
17
18
  - optionally saves an individual BTW exchange as a visible session note with `--save`
@@ -61,8 +62,10 @@ pi install /absolute/path/to/pi-btw
61
62
 
62
63
  - runs right away
63
64
  - works while pi is busy
65
+ - creates or reuses a real BTW sub-session instead of a one-off completion call
64
66
  - continues the current BTW thread
65
- - streams into a widget above the editor
67
+ - opens or refreshes the focused BTW modal shell
68
+ - streams into the BTW modal transcript/status surface
66
69
  - persists the BTW exchange as hidden thread state
67
70
  - with `--save`, also saves that single exchange as a visible session note
68
71
 
@@ -71,18 +74,19 @@ pi install /absolute/path/to/pi-btw
71
74
  - clears the current BTW thread
72
75
  - starts a fresh thread that still inherits the current main-session context
73
76
  - optionally asks the first question in the new thread immediately
77
+ - if no question is provided, opens a fresh BTW modal ready for the next prompt
74
78
 
75
79
  ### `/btw:tangent [--save] <question>`
76
80
 
77
81
  - starts or continues a contextless tangent thread
78
82
  - does not inherit the current main-session conversation
79
83
  - 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
84
+ - opens or refreshes the same focused BTW modal shell
81
85
  - with `--save`, also saves that single exchange as a visible session note
82
86
 
83
87
  ### `/btw:clear`
84
88
 
85
- - dismisses the BTW widget
89
+ - dismisses the BTW modal/widget
86
90
  - clears the current BTW thread
87
91
 
88
92
  ### `/btw:inject [instructions]`
@@ -100,12 +104,34 @@ pi install /absolute/path/to/pi-btw
100
104
 
101
105
  ## Behavior
102
106
 
107
+ ### Real sub-session model
108
+
109
+ BTW is implemented as an actual pi sub-session with its own in-memory session state, transcript events, and tool surface.
110
+
111
+ - contextual `/btw` threads seed that sub-session from the current main-session branch while filtering out BTW-visible notes from the parent context
112
+ - `/btw:tangent` starts the same BTW UI in a contextless mode with no inherited main-session conversation
113
+ - 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
114
+ - handoff commands (`/btw:inject` and `/btw:summarize`) read from the BTW sub-session thread rather than maintaining a separate manual transcript model
115
+
116
+ ### In-modal slash behavior
117
+
118
+ Inside the BTW modal composer, slash handling is split at the BTW/session boundary:
119
+
120
+ - `/btw:new`, `/btw:tangent`, `/btw:clear`, `/btw:inject`, and `/btw:summarize` stay owned by BTW because they control BTW lifecycle or handoff behavior
121
+ - any other slash-prefixed input is routed through the BTW sub-session's normal `prompt()` path
122
+ - this means ordinary pi slash commands like `/help` are handled by the sub-session instead of being rejected by a modal-only fallback
123
+ - 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
124
+
125
+ This keeps BTW-owned lifecycle commands explicit while giving the side conversation the same slash-command surface as the underlying sub-session.
126
+
127
+ ## Behavior
128
+
103
129
  ### Hidden BTW thread state
104
130
 
105
131
  BTW exchanges are persisted in the session as hidden custom entries so they:
106
132
 
107
133
  - survive reloads and restarts
108
- - rehydrate the BTW widget for the current branch
134
+ - rehydrate the BTW modal shell for the current branch
109
135
  - preserve whether the current side thread is a normal `/btw` thread or a contextless `/btw:tangent`
110
136
  - stay out of the main agent's LLM context
111
137
 
Binary file