@bahulam/code 2.6.1 → 2.6.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.
@@ -19,7 +19,7 @@
19
19
  * none → identity (input returned unchanged)
20
20
  *
21
21
  * Brand identity (Mission Control PRD-055):
22
- * primary Deep Space Purple #7c3aed
22
+ * primary Abundance Cyan #06b6d4
23
23
  * accent Stellar Magenta #ec4899
24
24
  * data Neon Cyan #22d3ee
25
25
  * success Aligned green #22c55e
@@ -40,7 +40,7 @@ const RESET = `${ESC}0m`;
40
40
 
41
41
  export const TOKENS = Object.freeze({
42
42
  // Brand
43
- 'brand.primary': { rgb: [124, 58, 237], ansi256: 99, ansi16: 'magenta' }, // #7c3aed
43
+ 'brand.primary': { rgb: [6, 182, 212], ansi256: 44, ansi16: 'cyan' }, // #06b6d4
44
44
  'brand.accent': { rgb: [236, 72, 153], ansi256: 198, ansi16: 'magenta' }, // #ec4899
45
45
  'brand.data': { rgb: [34, 211, 238], ansi256: 87, ansi16: 'cyan' }, // #22d3ee
46
46
 
@@ -90,7 +90,19 @@ export function summarizeResult(tool, data) {
90
90
  return { text: 'timed out', tone: 'danger' };
91
91
  }
92
92
  if (data.success === false) {
93
- const msg = String(data.error || firstOutputLine(data) || 'failed').slice(0, 140);
93
+ // For shell / test / build / lint / validate failures, the actual output
94
+ // usually holds the actionable line ("FAIL src/foo.test.js expected 3
95
+ // got 2") while data.error is a generic wrapper ("Test suite failed",
96
+ // "Command exited with code 1"). Prefer the first output line when it
97
+ // has meaningful content; fall back to error for other tools.
98
+ const shellFamily = new Set([
99
+ 'shell', 'run_tests', 'validate_build', 'lint_check',
100
+ 'validate_file', 'validate_structure',
101
+ ]);
102
+ const outputLine = firstOutputLine(data);
103
+ const msg = shellFamily.has(tool) && outputLine
104
+ ? String(outputLine).slice(0, 140)
105
+ : String(data.error || outputLine || 'failed').slice(0, 140);
94
106
  return { text: msg, tone: 'danger' };
95
107
  }
96
108
 
@@ -344,9 +356,17 @@ export function formatCard({ tool, args, result, durationMs, indent, columns, cw
344
356
  const candidate = `${head} ${arrow} ${body}${tail}`;
345
357
  if (!head.includes('\n') && visibleWidth(candidate) <= cols) return candidate;
346
358
  if (!head.includes('\n') && isInlineOutcomeTool(tool)) {
359
+ // Reserve = outcome width + 4 (2 gap + a couple padding). Compact the head
360
+ // to whatever remains. Floor at 12 so the head stays recognizable; on
361
+ // very narrow terminals (cols - reserve < 12) fall through to the
362
+ // two-line gutter shape below rather than emit an overflowing line.
347
363
  const reserve = visibleWidth(`${arrow} ${body}${tail}`) + 4;
348
- const compactHead = truncateMiddle(head, Math.max(28, cols - reserve));
349
- return `${compactHead} ${arrow} ${body}${tail}`;
364
+ const headBudget = cols - reserve;
365
+ if (headBudget >= 12) {
366
+ const compactHead = truncateMiddle(head, headBudget);
367
+ const combined = `${compactHead} ${arrow} ${body}${tail}`;
368
+ if (visibleWidth(combined) <= cols) return combined;
369
+ }
350
370
  }
351
371
 
352
372
  // Doesn't fit on one line → push outcome to a separate gutter line.