@xynogen/pix-pretty 1.6.0 → 1.6.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.
- package/README.md +23 -10
- package/package.json +1 -1
- package/src/index.ts +1 -8
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ Complete rendering and formatting solution for Pi Coding Agent with syntax highl
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
### Tool Output Rendering
|
|
8
|
+
|
|
8
9
|
- **Syntax highlighting** - Uses `cli-highlight` (highlight.js-backed) for code blocks
|
|
9
10
|
- **File icons** - Visual file type indicators in ls/find output
|
|
10
11
|
- **Tree views** - Hierarchical directory display
|
|
@@ -14,21 +15,23 @@ Complete rendering and formatting solution for Pi Coding Agent with syntax highl
|
|
|
14
15
|
- **Bash exit summary** - Command status and timing info
|
|
15
16
|
|
|
16
17
|
### Paste Chip Formatting
|
|
18
|
+
|
|
17
19
|
- **Image path collapsing** - Converts `/tmp/pi-clipboard-abc.png` → `[paste image #1]`
|
|
18
20
|
- **Text paste markers** - Long pasted text → `[paste text +42 lines]`
|
|
19
21
|
- **Atomic deletion** - Delete entire paste markers as single units
|
|
20
22
|
- **Type-aware labels** - Visual distinction between image and text pastes
|
|
21
23
|
|
|
22
24
|
### Reasoning Tag Rendering
|
|
23
|
-
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
25
|
+
|
|
26
|
+
- **Live streaming** - Splits `<think>`/`<thinking>` regions into native Pi `thinking` content blocks token-by-token during streaming
|
|
27
|
+
- **Finalized cleanup** - On `message_end`, re-splits every affected text block for persistence (the finalized message bypasses the live rebuild)
|
|
28
|
+
- **Partial-tag safety** - Strips trailing half-streamed tags (e.g. `<thin`) so they never flash as literal text
|
|
29
|
+
- **Visual distinction** - Uses Pi's native `thinking` block rendering (dim + italic via `thinkingText` theme token) — no ANSI injection, no markdown blockquote shim
|
|
27
30
|
|
|
28
31
|
## Installation
|
|
29
32
|
|
|
30
33
|
```bash
|
|
31
|
-
pi install
|
|
34
|
+
pi install npm:@xynogen/pix-pretty
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
## Configuration
|
|
@@ -36,8 +39,9 @@ pi install git:github.com/xynogen/pix-pretty
|
|
|
36
39
|
### Environment Variables
|
|
37
40
|
|
|
38
41
|
**Tool rendering:**
|
|
42
|
+
|
|
39
43
|
- `PRETTY_THEME` - Color theme for syntax highlighting
|
|
40
|
-
- `PRETTY_MAX_HL_CHARS` - Max characters to highlight (default:
|
|
44
|
+
- `PRETTY_MAX_HL_CHARS` - Max characters to highlight (default: 80000)
|
|
41
45
|
- `PRETTY_MAX_PREVIEW_LINES` - Max lines in preview output
|
|
42
46
|
- `PRETTY_CACHE_LIMIT` - FFF cache size limit
|
|
43
47
|
- `PRETTY_ICONS` - Enable/disable file icons
|
|
@@ -49,8 +53,9 @@ pi install git:github.com/xynogen/pix-pretty
|
|
|
49
53
|
|
|
50
54
|
This package combines two rendering systems:
|
|
51
55
|
|
|
52
|
-
1. **
|
|
53
|
-
2. **Paste chip formatting** (`src/paste-chips.ts`) - Custom editor component for paste markers
|
|
56
|
+
1. **Theme + FFF commands** (`src/index.ts`) - Initialises syntax-highlight theme from Pi settings, clears highlight cache, and registers FFF slash commands. Tool renderers live in the standalone `pix-{read,bash,ls,find,grep,edit,write}` packages — each self-registers via its own Pi extension entry point.
|
|
57
|
+
2. **Paste chip formatting** (`src/paste-chips.ts`) - Custom editor component for paste markers.
|
|
58
|
+
3. **Reasoning tag rendering** (`src/thinking.ts`) - Converts leaked `<think>`/`<thinking>` tags into native Pi `thinking` content blocks (dim + italic via `thinkingText` theme token).
|
|
54
59
|
|
|
55
60
|
Both work independently but complement each other for a cohesive visual experience.
|
|
56
61
|
|
|
@@ -64,10 +69,18 @@ Key divergences from upstream:
|
|
|
64
69
|
2. **FFF state dir** - `~/.pi/agent/pi-pretty/fff` → `~/.cache/pi/fff` (XDG cache)
|
|
65
70
|
3. **Split diff view for edit/write tools** - Full side-by-side diff with gutter, line numbers, syntax highlighting
|
|
66
71
|
4. **Paste chip formatting** - Custom editor component for Pi's paste marker system (not in upstream)
|
|
67
|
-
5. **Reasoning tag rendering** -
|
|
72
|
+
5. **Reasoning tag rendering** - Converts leaked `<think>`/`<thinking>` tags into native Pi `thinking` content blocks (not in upstream)
|
|
68
73
|
|
|
69
74
|
Paste chip formatting and reasoning tag rendering are original additions with no upstream equivalent.
|
|
70
75
|
|
|
76
|
+
## Full distro
|
|
77
|
+
|
|
78
|
+
To install the complete pix suite (all packages + Pi itself):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
curl -fsSL https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.sh | sh
|
|
82
|
+
```
|
|
83
|
+
|
|
71
84
|
## License
|
|
72
85
|
|
|
73
|
-
MIT
|
|
86
|
+
MIT
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* commands/ slash command registrars (fff)
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
26
27
|
import { registerFffCommands } from "./commands/fff.js";
|
|
27
28
|
import { getDefaultAgentDir, setPrettyTheme } from "./config.js";
|
|
28
29
|
import { fffState } from "./fff.js";
|
|
@@ -30,15 +31,7 @@ import { clearHighlightCache } from "./highlight.js";
|
|
|
30
31
|
import type { PiPrettyApi } from "./types.js";
|
|
31
32
|
|
|
32
33
|
export default function piPrettyExtension(pi: PiPrettyApi): void {
|
|
33
|
-
let sdk: { getAgentDir?: () => string };
|
|
34
|
-
try {
|
|
35
|
-
sdk = require("@earendil-works/pi-coding-agent");
|
|
36
|
-
} catch {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
34
|
// ── Theme init ──────────────────────────────────────────────────────
|
|
41
|
-
const getAgentDir = sdk.getAgentDir;
|
|
42
35
|
setPrettyTheme(
|
|
43
36
|
(() => {
|
|
44
37
|
try {
|