@dreb/coding-agent 2.34.1 → 2.34.3

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/docs/buddy.md CHANGED
@@ -33,7 +33,7 @@ The buddy won't react until a model is configured. The choice is persisted acros
33
33
  | `/buddy pet` | Pet your buddy |
34
34
  | `/buddy reroll` | Reroll for a new buddy (new species, name, personality) |
35
35
  | `/buddy stats` | Show buddy stats panel |
36
- | `/buddy off` | Hide the buddy (persists across sessions it stays hidden on restart until you run `/buddy`) |
36
+ | `/buddy off` | Hide the buddy (persists across sessions, and syncs to any other dreb instance running concurrently — see [Persistence & multiple instances](#persistence--multiple-instances)) |
37
37
 
38
38
  ## How It Works
39
39
 
@@ -42,6 +42,14 @@ The buddy won't react until a model is configured. The choice is persisted acros
42
42
  - **Reactions** are generated by the local Ollama model — short, in-character quips based on what just happened
43
43
  - **Activity indicator** shows "thinking..." in the buddy panel while waiting for Ollama to respond
44
44
 
45
+ ## Persistence & multiple instances
46
+
47
+ The buddy's state — including whether it's hidden via `/buddy off` — lives in a shared file at `~/.dreb/agent/buddy.json`. All dreb instances on the machine (multiple TUIs, and the Telegram bridge) read and write the same file.
48
+
49
+ Because the state is shared, `/buddy off` (and bringing the buddy back with `/buddy`) **converges across every concurrently-running instance**: each instance re-checks the persisted flag at turn boundaries (when you send a message and when the agent finishes responding), so a buddy you hide in one terminal disappears from the others within one interaction — no restart required. Deleting `~/.dreb/agent/buddy.json` removes the buddy entirely on the next interaction everywhere.
50
+
51
+ > Note: convergence happens on the next interaction in each instance, not instantly while an instance sits completely idle.
52
+
45
53
  ## Troubleshooting
46
54
 
47
55
  ### Buddy never reacts / always shows fallback message
package/docs/tui.md CHANGED
@@ -21,12 +21,12 @@ interface Component {
21
21
 
22
22
  | Method | Description |
23
23
  |--------|-------------|
24
- | `render(width)` | Return array of strings (one per line). Each line **must not exceed `width`**. |
24
+ | `render(width)` | Return array of strings, one logical line per entry. Entries **must not contain raw `\n` or `\r`**; split multi-line content into separate entries. Each unmarked line **must not exceed `width`**. |
25
25
  | `handleInput?(data)` | Receive keyboard input when component has focus. |
26
26
  | `wantsKeyRelease?` | If true, component receives key release events (Kitty protocol). Default: false. |
27
27
  | `invalidate()` | Clear cached render state. Called on theme changes. |
28
28
 
29
- The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered line. Styles do not carry across lines. If you emit multi-line text with styling, reapply styles per line or use `wrapTextWithAnsi()` so styles are preserved for each wrapped line.
29
+ The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered line. Styles do not carry across lines. If you emit multi-line text with styling, split it into separate render entries and reapply styles per line, or use `wrapTextWithAnsi()` so styles are preserved for each wrapped line.
30
30
 
31
31
  ## Focusable Interface (IME Support)
32
32
 
@@ -287,21 +287,21 @@ handleInput(data: string) {
287
287
 
288
288
  ## Line Width
289
289
 
290
- **Critical:** Each line from `render()` must not exceed the `width` parameter.
290
+ **Critical:** Each entry from `render()` must represent one logical line and must not contain raw `\n` or `\r`. Split multi-line content before returning it. Unmarked lines must not exceed the `width` parameter.
291
291
 
292
292
  ```typescript
293
- import { visibleWidth, truncateToWidth } from "@dreb/tui";
293
+ import { visibleWidth, truncateToWidth, wrapTextWithAnsi } from "@dreb/tui";
294
294
 
295
295
  render(width: number): string[] {
296
- // Truncate long lines
297
- return [truncateToWidth(this.text, width)];
296
+ // Split styled multi-line content into separate render entries.
297
+ return wrapTextWithAnsi(this.text.replace(/\r\n?/g, "\n"), width);
298
298
  }
299
299
  ```
300
300
 
301
301
  Utilities:
302
302
  - `visibleWidth(str)` - Get display width (ignores ANSI codes)
303
303
  - `truncateToWidth(str, width, ellipsis?)` - Truncate with optional ellipsis
304
- - `wrapTextWithAnsi(str, width)` - Word wrap preserving ANSI codes
304
+ - `wrapTextWithAnsi(str, width)` - Word wrap preserving ANSI codes and splitting on raw line breaks
305
305
 
306
306
  ## Creating Custom Components
307
307
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreb/coding-agent",
3
- "version": "2.34.1",
3
+ "version": "2.34.3",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drebConfig": {