@pi-archimedes/diff 2.5.1 → 2.6.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/README.md +35 -26
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,49 +1,58 @@
|
|
|
1
1
|
# @pi-archimedes/diff
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**See what changed. Not just that something changed.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## What you get
|
|
8
|
-
|
|
9
|
-
- **Split and unified views** — side-by-side split diff or traditional unified view, auto-selected based on terminal width
|
|
10
|
-
- **Shiki syntax highlighting** — full syntax highlighting powered by [Shiki](https://shiki.style), with auto-derived theme colors
|
|
11
|
-
- **Word-level emphasis** — changed characters within lines are highlighted at word level for precise change tracking
|
|
12
|
-
- **Graceful fallback** — falls back to plain text diff when Shiki is unavailable or the language is unrecognized
|
|
13
|
-
- **Configurable thresholds** — control minimum terminal width for split view and minimum code width per side
|
|
14
|
-
|
|
15
|
-
## Screenshots
|
|
16
|
-
|
|
17
|
-
### Split diff view
|
|
18
|
-
|
|
19
|
-
Side-by-side diff with syntax highlighting, word-level emphasis on changed characters, and line numbers:
|
|
20
|
-
|
|
21
|
-

|
|
5
|
+
Raw text diffs make it easy to miss the one line that matters. Diff puts [Shiki](https://shiki.style)-syntax-highlighted changes in front of you — side by side when there's room, unified when there isn't — with word-level emphasis on the parts that actually moved inside each line.
|
|
22
6
|
|
|
23
7
|
## Install
|
|
24
8
|
|
|
9
|
+
Standalone:
|
|
10
|
+
|
|
25
11
|
```bash
|
|
26
12
|
pi install npm:@pi-archimedes/diff
|
|
27
13
|
```
|
|
28
14
|
|
|
29
|
-
Or
|
|
15
|
+
Or the full suite instead:
|
|
30
16
|
|
|
31
17
|
```bash
|
|
32
18
|
pi install npm:pi-archimedes
|
|
33
19
|
```
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
New to Pi? Pi itself is a one-time global install and needs Node.js ≥ 22.19.0:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
After installing Pi, choose one installation command above, then `cd` into your project and run `pi`. Inside the session, `/login` signs you in and `/model` picks a model — the [setup section](https://github.com/danielcherubini/pi-archimedes#setup) walks through the first run. A running session picks the diff renderer up with `/reload`.
|
|
28
|
+
|
|
29
|
+
<div align="center">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/danielcherubini/pi-archimedes/main/docs/images/diff-edit.png" width="700" alt="Shiki syntax-highlighted split diff">
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
## What you get
|
|
34
|
+
|
|
35
|
+
- **Split view, and unified when it isn't** — side-by-side diffs when the terminal is wide enough; a traditional unified view when it isn't. The choice is made automatically from the column width.
|
|
36
|
+
- **Syntax highlighting** — language-aware colouring of the diff body, from a Shiki theme.
|
|
37
|
+
- **Word-level emphasis** — sub-line highlighting that shows exactly which tokens changed inside an otherwise similar line.
|
|
38
|
+
- **Graceful fallback** — when Shiki is unavailable or the format isn't recognised, the change is shown as a plain text diff.
|
|
39
|
+
|
|
40
|
+
## What it does (and doesn't) do
|
|
41
|
+
|
|
42
|
+
The renderer displays `edit` and `write` tool changes in the tool UI, including call previews. It is **not an approval gate** — it helps you read changes as they happen; it doesn't hold changes back.
|
|
43
|
+
|
|
44
|
+
## Appearance
|
|
45
|
+
|
|
46
|
+
Standalone, the renderer runs on fixed defaults — the `github-dark` theme, a 150-column minimum for split view, and 60 code columns per side — and it does **not** read settings, because standalone has no config reader. In the [suite](https://github.com/danielcherubini/pi-archimedes), its `archimedes.diff` namespace supplies the same three values (`diffTheme`, `diffSplitMinWidth`, `diffSplitMinCodeWidth`) through the suite's config reader:
|
|
36
47
|
|
|
37
48
|
| Setting | Type | Default | Description |
|
|
38
49
|
|---------|------|---------|-------------|
|
|
39
50
|
| `diffTheme` | string | `github-dark` | Shiki syntax-highlighting theme |
|
|
40
|
-
| `diffSplitMinWidth` | number | `150` | Minimum terminal columns
|
|
51
|
+
| `diffSplitMinWidth` | number | `150` | Minimum terminal columns for split view (≥ 100) |
|
|
41
52
|
| `diffSplitMinCodeWidth` | number | `60` | Minimum code columns per side in split view (≥ 30) |
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Integration
|
|
54
|
+
The palette is derived from the chosen Shiki theme; it does **not** automatically pick up Pi's active theme colours. If you want a different look, pick a closer theme rather than expecting a live match.
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
On/off is managed by the suite: toggle via `/plugins` (`archimedes.diff.enabled`, default on).
|
|
48
57
|
|
|
49
|
-
← Back to
|
|
58
|
+
← [Back to pi-archimedes](https://github.com/danielcherubini/pi-archimedes)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-archimedes/diff",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@earendil-works/pi-tui": ">=0.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
28
|
-
"@earendil-works/pi-tui": "^0.
|
|
27
|
+
"@earendil-works/pi-coding-agent": "^0.85.1",
|
|
28
|
+
"@earendil-works/pi-tui": "^0.85.1",
|
|
29
29
|
"@types/diff": "^7.0.2",
|
|
30
30
|
"typescript": "^6.0.0"
|
|
31
31
|
},
|