donsetch 2.2.3 → 2.2.4
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/pi-extension.ts +15 -15
package/package.json
CHANGED
package/pi-extension.ts
CHANGED
|
@@ -31,15 +31,13 @@ const INIT_TIMEOUT_MS = 10_000;
|
|
|
31
31
|
const CALL_TIMEOUT_MS = 120_000;
|
|
32
32
|
const SHUTDOWN_GRACE_MS = 2_000;
|
|
33
33
|
|
|
34
|
-
// ──
|
|
35
|
-
// Pi's TUI wraps
|
|
36
|
-
// We
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const C_CREAM = "\x1b[38;2;240;230;210m";
|
|
42
|
-
const RESET = "\x1b[0m";
|
|
34
|
+
// ── TUI rendering note ──
|
|
35
|
+
// Pi's TUI wraps tool calls in its own green (success) / red (failure)
|
|
36
|
+
// highlight. We output PLAIN TEXT only — no ANSI color codes. Any
|
|
37
|
+
// ANSI we emit (especially RESET) breaks pi's overlay mid-line,
|
|
38
|
+
// causing text to fall outside the green/red highlight and show
|
|
39
|
+
// with the TUI background color instead. Plain text = pi colors
|
|
40
|
+
// the whole thing uniformly.
|
|
43
41
|
|
|
44
42
|
// ── Tool icons ──
|
|
45
43
|
const ICONS: Record<string, string> = {
|
|
@@ -431,15 +429,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
431
429
|
} else if (args?.query) {
|
|
432
430
|
key = truncateToWidth(`"${args.query}"`, 50, "\u2026");
|
|
433
431
|
}
|
|
432
|
+
// Plain text only — no ANSI codes. Pi wraps tool calls
|
|
433
|
+
// in its own green (success) / red (failure) highlight.
|
|
434
|
+
// Any ANSI we emit breaks pi's overlay mid-line.
|
|
434
435
|
return new Text(
|
|
435
|
-
`${
|
|
436
|
+
`${icon} ${toolName} ${key}`,
|
|
436
437
|
0, 0
|
|
437
438
|
);
|
|
438
439
|
},
|
|
439
440
|
|
|
440
441
|
renderResult(result: any, opts: any, _theme: any) {
|
|
441
442
|
if (opts?.isPartial) {
|
|
442
|
-
return new Text(`${
|
|
443
|
+
return new Text(`${toolName} working…`, 0, 0);
|
|
443
444
|
}
|
|
444
445
|
|
|
445
446
|
const isErr = result?.isError || result?.details?.isError;
|
|
@@ -474,11 +475,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
474
475
|
line2 = d.preview;
|
|
475
476
|
}
|
|
476
477
|
|
|
477
|
-
//
|
|
478
|
-
|
|
479
|
-
const line1 = `${C_AMBER}${toolName}${RESET} ${C_DIM}\u00B7 ${meta}${RESET}`;
|
|
478
|
+
// Plain text only — no ANSI. Pi handles all coloring.
|
|
479
|
+
const line1 = `${toolName} \u00B7 ${meta}`;
|
|
480
480
|
const output = line2
|
|
481
|
-
? `${line1}\n ${
|
|
481
|
+
? `${line1}\n ${line2}`
|
|
482
482
|
: line1;
|
|
483
483
|
|
|
484
484
|
return new Text(output, 0, 0);
|