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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pi-extension.ts +15 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donsetch",
3
- "version": "2.2.3",
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,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
- // ── Color palette DonSeTch amber theme ──
35
- // Pi's TUI wraps successful tool calls in green and failures in red.
36
- // We do NOT use green or red in our render output — that's pi's job.
37
- // Amber for our own accents (tool name, icons), dim for metadata.
38
- // Clean separation: pi handles success/fail coloring, we handle content.
39
- const C_AMBER = "\x1b[38;2;255;178;0m";
40
- const C_DIM = "\x1b[38;2;130;130;140m";
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
- `${C_AMBER}${icon}${RESET} ${C_CREAM}${toolName}${RESET} ${C_DIM}${key}${RESET}`,
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(`${C_AMBER}\u23F3${RESET} ${C_DIM}${toolName} working…${RESET}`, 0, 0);
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
- // No glyph coloringpi wraps the whole result in green
478
- // (success) or red (failure). We just output the text.
479
- const line1 = `${C_AMBER}${toolName}${RESET} ${C_DIM}\u00B7 ${meta}${RESET}`;
478
+ // Plain text onlyno ANSI. Pi handles all coloring.
479
+ const line1 = `${toolName} \u00B7 ${meta}`;
480
480
  const output = line2
481
- ? `${line1}\n ${C_DIM}${line2}${RESET}`
481
+ ? `${line1}\n ${line2}`
482
482
  : line1;
483
483
 
484
484
  return new Text(output, 0, 0);