@giladbarnea/pi-pretty-bash 1.0.2 → 1.0.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 +1 -1
- package/index.ts +4 -2
- package/package.json +8 -2
package/README.md
CHANGED
package/index.ts
CHANGED
|
@@ -77,11 +77,13 @@ export default function prettyBash(pi: ExtensionAPI): void {
|
|
|
77
77
|
if (!shouldHighlight) {
|
|
78
78
|
return component;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
// Pi renders expanded output as one component, and collapsed output as a spacer followed by its preview.
|
|
81
|
+
const outputIndex = options.expanded ? 0 : 1;
|
|
82
|
+
if (!hasChildren(component) || !component.children[outputIndex]) {
|
|
81
83
|
throw new Error("Pi's Bash result renderer no longer exposes its output component");
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
const outputComponent = component.children[
|
|
86
|
+
const outputComponent = component.children[outputIndex];
|
|
85
87
|
const renderOutput = outputComponent.render.bind(outputComponent);
|
|
86
88
|
const highlightedOutput = highlightCode(output, "json").join("\n");
|
|
87
89
|
const maxVisualLines = options.expanded ? Number.POSITIVE_INFINITY : BASH_PREVIEW_LINES;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giladbarnea/pi-pretty-bash",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Syntax-highlight Bash tool calls and JSON output in Pi's TUI.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"screenshots/1.png"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
31
|
+
"@earendil-works/pi-coding-agent": ">=0.99.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
@@ -37,5 +37,11 @@
|
|
|
37
37
|
"extensions": [
|
|
38
38
|
"./index.ts"
|
|
39
39
|
]
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@earendil-works/pi-coding-agent": "1.1.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "node --test test/*.test.mjs"
|
|
40
46
|
}
|
|
41
47
|
}
|