pi-bro 0.13.1 → 0.13.2

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bro.ts +13 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to pi-bro are documented here.
4
4
 
5
+ ## [0.13.2] - 2026-09-19
6
+
7
+ ### Changed
8
+
9
+ - In the `/bro btw` modal, your questions now render as a quoted **You** block and answers carry an explicit **Bro** label, with a horizontal rule between turns. The old `## you` heading was indistinguishable from headings inside Bro's answers.
10
+
5
11
  ## [0.13.1] - 2026-09-17
6
12
 
7
13
  ### Changed
package/bro.ts CHANGED
@@ -1475,6 +1475,18 @@ export function resolveBtwThread(existing: BtwThread | undefined, parsed: { fres
1475
1475
  return !existing || startFresh ? { turns: [], full: targetFull } : existing;
1476
1476
  }
1477
1477
 
1478
+ export function formatBtwTranscript(turns: readonly BtwTurn[]): string {
1479
+ return turns
1480
+ .map((turn) => {
1481
+ const question = turn.question.split(/\r?\n/).map((line) => (line ? `> ${line}` : ">")).join("\n");
1482
+ // A turn aborted mid-stream can end inside an unclosed code fence, which would swallow the
1483
+ // separator and every later turn; close it so each turn renders as its own block.
1484
+ const answer = (turn.answer.match(/^```/gm)?.length ?? 0) % 2 === 1 ? `${turn.answer}\n\`\`\`` : turn.answer;
1485
+ return `> **You**\n>\n${question}\n\n**Bro**\n\n${answer}`;
1486
+ })
1487
+ .join("\n\n---\n\n");
1488
+ }
1489
+
1478
1490
  export function parseBtwAgyLine(line: string): { delta?: string; result?: string; conversationId?: string; error?: string } {
1479
1491
  let event: AgyEvent;
1480
1492
  try {
@@ -1791,7 +1803,7 @@ async function openBtwModal(
1791
1803
  let closed = false;
1792
1804
  let controller: AbortController | undefined;
1793
1805
 
1794
- const transcript = () => thread.turns.map((turn) => `## you\n${turn.question}\n\n${turn.answer}`).join("\n\n");
1806
+ const transcript = () => formatBtwTranscript(thread.turns);
1795
1807
 
1796
1808
  const close = () => {
1797
1809
  if (closed) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bro",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "An Earendil Pi extension that explains pasted text, assistant responses, local documents, public webpages, and recent session turns (as shapes) in a context-isolated window, and opens a sandboxed side conversation with /bro btw.",
5
5
  "type": "module",
6
6
  "license": "MIT",