/** * /btw extension — side-channel chat in a floating window * * Usage: /btw * * Opens a side-chat window backed by a one-off LLM thread (streamSimple) that * sees the current branch context + your questions. Answers stream live into * the window and follow-ups can be typed right there — the main agent's * context is never touched, no matter how deep the thread goes. * * From the window (when idle): * enter send a follow-up * esc close (streaming: cancel the in-flight answer) * ctrl+p promote — close and hand the thread to the main agent * ctrl+f fork — write branch + thread to a new session file and open it: * tmux split (direction from pane width, PI_BTW_SPLIT=h|v to force) * → new Ghostty window (macOS) → clipboard + printed command * * On close the thread persists with pi.appendEntry() as a custom ENTRY: it * renders in the transcript but never participates in the agent's LLM * context and never triggers a turn. * * Why not pi.sendMessage()? Custom MESSAGES participate in LLM context and, * when sent while the agent is streaming, are delivered as steer messages — * which continues the agent loop with an extra LLM call. Our own context * filter then strips the btw message, leaving the conversation ending with an * assistant message, which models that reject assistant prefill 400 on. */ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent'; export default function (pi: ExtensionAPI): void;