@standardagents/code 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/dist/index.js CHANGED
@@ -429,6 +429,59 @@ 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
+ }
481
+ function gradientArt(lines) {
482
+ const n = Math.max(1, lines.length - 1);
483
+ return lines.map((line, i) => gradientText(line, i / n * 0.55));
484
+ }
432
485
 
433
486
  // src/bridge.ts
434
487
  var PATH_ARG_TOOLS = /* @__PURE__ */ new Set(["read_file", "grep", "glob", "write_file", "edit_file"]);
@@ -2378,7 +2431,7 @@ var Tui = class _Tui {
2378
2431
  return `${head}${stepPart} ${right}`;
2379
2432
  }
2380
2433
  if (this.goalComplete) {
2381
- const done = `${C.bold}${C.green}\u2713 Goal complete.${C.reset}`;
2434
+ const done = `${C.bold}${gradientText("\u2713 Goal complete.")}${C.reset}`;
2382
2435
  return tk ? `${done} ${tk}` : done;
2383
2436
  }
2384
2437
  return tk ? tk : null;
@@ -3815,16 +3868,17 @@ function printWelcome(endpoint, projectDir) {
3815
3868
  const version = readVersion();
3816
3869
  const pad = " ";
3817
3870
  const meta = [
3818
- `${c.bold}${c.white}Standard Code${c.reset}${version ? ` ${c.dim}v${version}${c.reset}` : ""}`,
3871
+ `${c.bold}${gradientText("Standard Code")}${c.reset}${version ? ` ${c.dim}v${version}${c.reset}` : ""}`,
3819
3872
  `${c.dim}terminal coding agent${c.reset}`,
3820
3873
  `${c.teal}${host}${c.reset}`,
3821
3874
  `${c.dim}${dir}${c.reset}`
3822
3875
  ];
3823
3876
  const markWidth = Math.max(...LOGO_MARK.map((l) => [...l].length));
3877
+ const gradMark = gradientArt(LOGO_MARK);
3824
3878
  const metaTop = Math.floor((LOGO_MARK.length - meta.length) / 2);
3825
3879
  stdout.write("\n");
3826
3880
  for (let i = 0; i < LOGO_MARK.length; i++) {
3827
- const glyph = LOGO_MARK[i].padEnd(markWidth);
3881
+ const glyph = gradMark[i].padEnd(markWidth + (gradMark[i].length - LOGO_MARK[i].length));
3828
3882
  const line = meta[i - metaTop];
3829
3883
  stdout.write(`${pad}${glyph}${line ? ` ${line}` : ""}
3830
3884
  `);