@heyhuynhgiabuu/pi-pretty 0.1.1 → 0.1.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/package.json +1 -1
- package/src/index.ts +7 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyhuynhgiabuu/pi-pretty",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Pretty terminal output for pi — syntax-highlighted file reads, colored bash output, tree-view directory listings, and more.",
|
|
5
5
|
"author": "huynhgiabuu",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -457,7 +457,6 @@ async function renderGrepResults(
|
|
|
457
457
|
// ---------------------------------------------------------------------------
|
|
458
458
|
|
|
459
459
|
export default function piPrettyExtension(pi: any): void {
|
|
460
|
-
console.error("[pi-pretty] Extension function called");
|
|
461
460
|
let createReadTool: any;
|
|
462
461
|
let createBashTool: any;
|
|
463
462
|
let createLsTool: any;
|
|
@@ -467,23 +466,16 @@ export default function piPrettyExtension(pi: any): void {
|
|
|
467
466
|
|
|
468
467
|
try {
|
|
469
468
|
const sdk = require("@mariozechner/pi-coding-agent");
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
createGrepTool = sdk.createGrepTool;
|
|
469
|
+
createReadTool = sdk.createReadToolDefinition ?? sdk.createReadTool;
|
|
470
|
+
createBashTool = sdk.createBashToolDefinition ?? sdk.createBashTool;
|
|
471
|
+
createLsTool = sdk.createLsToolDefinition ?? sdk.createLsTool;
|
|
472
|
+
createFindTool = sdk.createFindToolDefinition ?? sdk.createFindTool;
|
|
473
|
+
createGrepTool = sdk.createGrepToolDefinition ?? sdk.createGrepTool;
|
|
476
474
|
TextComponent = require("@mariozechner/pi-tui").Text;
|
|
477
|
-
|
|
478
|
-
} catch (e: any) {
|
|
479
|
-
console.error("[pi-pretty] LOAD ERROR:", e.message);
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
if (!createReadTool || !TextComponent) {
|
|
483
|
-
console.error("[pi-pretty] Missing: createReadTool=", typeof createReadTool, "TextComponent=", typeof TextComponent);
|
|
475
|
+
} catch {
|
|
484
476
|
return;
|
|
485
477
|
}
|
|
486
|
-
|
|
478
|
+
if (!createReadTool || !TextComponent) return;
|
|
487
479
|
|
|
488
480
|
const cwd = process.cwd();
|
|
489
481
|
const home = process.env.HOME ?? "";
|