Skip to content

Commit e141933

Browse files
chore(cli): move setup-cli-symlinks into cli/scripts and update postinstall
Move CLI-specific symlink setup into the CLI workspace and update the root postinstall and docs so callers use the new location. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 123a4ee commit e141933

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

cli/knowledge.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,48 @@ The CLI workspace depends on `@opentui/core` and `@opentui/react` from GitHub. T
433433
- Cross-platform (Windows, Mac, Linux)
434434
- Better error handling with TypeScript
435435
- Uses Node.js 'junction' symlinks which work universally
436-
- Automatically cleans up existing symlinks before creating new ones
436+
- Automatically cleans up existing symlinks before creating new ones## Toggle Branch Rendering
437+
438+
Agent and tool toggles in the TUI render inside `<text>` components. Expanded content must resolve to plain strings or StyledText-compatible fragments (`<span>`, `<strong>`, `<em>`).
439+
440+
### TextNodeRenderable Constraint
441+
442+
**Problem**: Markdown-rendered content that returned arbitrary React elements (e.g., nested `<box>` containers) under `<text>` caused errors when toggling branches:
443+
```
444+
Error: TextNodeRenderable only accepts strings, TextNodeRenderable instances, or StyledText instances
445+
```
446+
447+
**Solution**: `cli/src/components/branch-item.tsx` inspects expanded content:
448+
- If text-renderable → stays inside `<text>`
449+
- Otherwise → renders the raw element tree directly
450+
451+
This prevents invalid children from reaching `TextNodeRenderable` while preserving formatted markdown.
452+
453+
**Related**: `cli/src/hooks/use-message-renderer.tsx` ensures toggle headers render within a single `<text>` block for StyledText compatibility.
454+
455+
### Scroll Behavior
456+
457+
Toggling any agent/tool branch calls `scrollToAgent`, with each branch registering its container via `registerAgentRef`. This anchors the toggled item in the top third of the scrollbox for better navigation in long sessions.
458+
459+
## Command Menus
460+
461+
### Slash Commands (`/`)
462+
463+
Typing `/` opens a five-item slash menu above the input, mirroring npm-app commands.
464+
465+
**Navigation**:
466+
- Arrow keys or Tab/Shift+Tab to move highlight
467+
- Enter to insert selected command
468+
- List scrolls when moving beyond first five items
469+
470+
### Agent Mentions (`@`)
471+
472+
Typing `@` scans the local `.agents` directory and surfaces agent `displayName`s (e.g., `@Codebase Commands Explorer`).
473+
474+
**Navigation**:
475+
- Same as slash menu (arrows/Tab to navigate, Enter to insert)
476+
- Both menus cap visible list at five entries
477+
478+
## Streaming Markdown Optimization
479+
480+
Streaming markdown renders as plain text until the message or agent finishes. This prevents scroll jitter that occurred when partial formatting changed line heights mid-stream.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"cli"
1818
],
1919
"scripts": {
20-
"postinstall": "bun scripts/setup-cli-symlinks.ts",
20+
"postinstall": "bun cli/scripts/setup-cli-symlinks.ts",
2121
"dev": "bash scripts/dev.sh",
2222
"start-db": "bun --cwd common db:start",
2323
"start-bin": "bun --cwd npm-app start-bin",

0 commit comments

Comments
 (0)