donsetch 2.2.2 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pi-extension.ts +15 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donsetch",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "Web fetch, search and crawl for AI agents. Zero API keys. Chrome-true TLS.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "author": "Bishesh Bhandari",
package/pi-extension.ts CHANGED
@@ -31,16 +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
- // ── Color palette DonSeTch amber theme ──
35
- // Note: avoid green for success pi's TUI highlights successful tool
36
- // calls with green, and using green here causes a visual clash where
37
- // ANSI codes bleed into pi's highlight. Amber for success, red for
38
- // errors. Clean separation from pi's own colors.
39
- const C_AMBER = "\x1b[38;2;255;178;0m";
40
- const C_RED = "\x1b[38;2;229;115;115m";
41
- const C_DIM = "\x1b[38;2;130;130;140m";
42
- const C_CREAM = "\x1b[38;2;240;230;210m";
43
- 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.
44
41
 
45
42
  // ── Tool icons ──
46
43
  const ICONS: Record<string, string> = {
@@ -432,21 +429,22 @@ export default function (pi: ExtensionAPI) {
432
429
  } else if (args?.query) {
433
430
  key = truncateToWidth(`"${args.query}"`, 50, "\u2026");
434
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.
435
435
  return new Text(
436
- `${C_AMBER}${icon}${RESET} ${C_CREAM}${toolName}${RESET} ${C_DIM}${key}${RESET}`,
436
+ `${icon} ${toolName} ${key}`,
437
437
  0, 0
438
438
  );
439
439
  },
440
440
 
441
441
  renderResult(result: any, opts: any, _theme: any) {
442
442
  if (opts?.isPartial) {
443
- return new Text(`${C_AMBER}\u23F3${RESET} ${C_DIM}${toolName} working…${RESET}`, 0, 0);
443
+ return new Text(`${toolName} working…`, 0, 0);
444
444
  }
445
445
 
446
446
  const isErr = result?.isError || result?.details?.isError;
447
447
  const d = result?.details ?? {};
448
- const glyph = isErr ? "\u2717" : "\u2713";
449
- const glyphColor = isErr ? C_RED : C_AMBER;
450
448
 
451
449
  // Build metadata string per tool
452
450
  let meta = "";
@@ -477,9 +475,10 @@ export default function (pi: ExtensionAPI) {
477
475
  line2 = d.preview;
478
476
  }
479
477
 
480
- const line1 = `${glyphColor}${glyph}${RESET} ${C_CREAM}${toolName}${RESET} ${C_DIM}\u00B7 ${meta}${RESET}`;
478
+ // Plain text only no ANSI. Pi handles all coloring.
479
+ const line1 = `${toolName} \u00B7 ${meta}`;
481
480
  const output = line2
482
- ? `${line1}\n ${C_DIM}${line2}${RESET}`
481
+ ? `${line1}\n ${line2}`
483
482
  : line1;
484
483
 
485
484
  return new Text(output, 0, 0);