@standardagents/code 0.1.1 → 0.1.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/dist/index.js CHANGED
@@ -429,6 +429,55 @@ function highlightBash(cmd) {
429
429
  }
430
430
  return out;
431
431
  }
432
+ var GRAD_STOPS = [
433
+ [255, 179, 92],
434
+ // amber
435
+ [255, 92, 135],
436
+ // coral
437
+ [139, 108, 255]
438
+ // violet
439
+ ];
440
+ var GRAD_256 = [215, 210, 204, 176, 141];
441
+ function truecolor() {
442
+ const ct = process.env.COLORTERM ?? "";
443
+ if (/truecolor|24bit/i.test(ct)) return true;
444
+ return /iterm|kitty|wezterm|ghostty|alacritty/i.test(process.env.TERM_PROGRAM ?? "");
445
+ }
446
+ function gradAt(t) {
447
+ const clamped = Math.max(0, Math.min(1, t));
448
+ const seg = clamped * (GRAD_STOPS.length - 1);
449
+ const i = Math.min(GRAD_STOPS.length - 2, Math.floor(seg));
450
+ const k = seg - i;
451
+ const [a, b] = [GRAD_STOPS[i], GRAD_STOPS[i + 1]];
452
+ return [
453
+ Math.round(a[0] + (b[0] - a[0]) * k),
454
+ Math.round(a[1] + (b[1] - a[1]) * k),
455
+ Math.round(a[2] + (b[2] - a[2]) * k)
456
+ ];
457
+ }
458
+ function gradientText(text, phase = 0) {
459
+ const chars = [...text];
460
+ const visible = chars.filter((ch) => ch.trim().length > 0).length;
461
+ if (!visible) return text;
462
+ const tc = truecolor();
463
+ let seen = 0;
464
+ let out = "";
465
+ for (const ch of chars) {
466
+ if (ch.trim().length === 0) {
467
+ out += ch;
468
+ continue;
469
+ }
470
+ const t = Math.min(1, phase + seen / Math.max(1, visible - 1) * (1 - phase * 0.4));
471
+ seen++;
472
+ if (tc) {
473
+ const [r, g, b] = gradAt(t);
474
+ out += `\x1B[38;2;${r};${g};${b}m${ch}`;
475
+ } else {
476
+ out += `\x1B[38;5;${GRAD_256[Math.min(GRAD_256.length - 1, Math.floor(t * GRAD_256.length))]}m${ch}`;
477
+ }
478
+ }
479
+ return out + "\x1B[0m";
480
+ }
432
481
 
433
482
  // src/bridge.ts
434
483
  var PATH_ARG_TOOLS = /* @__PURE__ */ new Set(["read_file", "grep", "glob", "write_file", "edit_file"]);
@@ -2378,7 +2427,7 @@ var Tui = class _Tui {
2378
2427
  return `${head}${stepPart} ${right}`;
2379
2428
  }
2380
2429
  if (this.goalComplete) {
2381
- const done = `${C.bold}${C.green}\u2713 Goal complete.${C.reset}`;
2430
+ const done = `${C.bold}${gradientText("\u2713 Goal complete.")}${C.reset}`;
2382
2431
  return tk ? `${done} ${tk}` : done;
2383
2432
  }
2384
2433
  return tk ? tk : null;
@@ -3815,7 +3864,7 @@ function printWelcome(endpoint, projectDir) {
3815
3864
  const version = readVersion();
3816
3865
  const pad = " ";
3817
3866
  const meta = [
3818
- `${c.bold}${c.white}Standard Code${c.reset}${version ? ` ${c.dim}v${version}${c.reset}` : ""}`,
3867
+ `${c.bold}${gradientText("Standard Code")}${c.reset}${version ? ` ${c.dim}v${version}${c.reset}` : ""}`,
3819
3868
  `${c.dim}terminal coding agent${c.reset}`,
3820
3869
  `${c.teal}${host}${c.reset}`,
3821
3870
  `${c.dim}${dir}${c.reset}`