murmur8 3.5.0 → 4.1.1

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/src/theme.js ADDED
@@ -0,0 +1,119 @@
1
+ 'use strict';
2
+
3
+ // --- Banner ---
4
+
5
+ const BANNER = `
6
+ }
7
+ } }
8
+ } } }
9
+ } } } }
10
+ } } } }
11
+ } }
12
+ }
13
+ `;
14
+
15
+ function banner(useColor) {
16
+ const art = BANNER;
17
+ if (useColor) {
18
+ return `\x1b[36m${art}\x1b[0m`;
19
+ }
20
+ return art;
21
+ }
22
+
23
+ // --- Glyphs & Labels ---
24
+
25
+ const STAGE_GLYPH = '}';
26
+
27
+ const STAGE_LABELS = {
28
+ alex: 'creating feature spec',
29
+ cass: 'writing user stories',
30
+ nigel: 'building tests',
31
+ 'codey-plan': 'drafting implementation plan',
32
+ 'codey-implement': 'implementing feature'
33
+ };
34
+
35
+ const STAGE_NAMES = {
36
+ alex: 'Alex',
37
+ cass: 'Cass',
38
+ nigel: 'Nigel',
39
+ 'codey-plan': 'Codey',
40
+ 'codey-implement': 'Codey'
41
+ };
42
+
43
+ // --- Status Icons (replacing emoji) ---
44
+
45
+ const STATUS_ICONS = {
46
+ 'parallel_queued': '\u00b7', // ·
47
+ 'worktree_created': '\u25cb', // ○
48
+ 'parallel_running': '\u25d4', // ◔
49
+ 'merge_pending': '\u25d1', // ◑
50
+ 'parallel_complete': '\u2713', // ✓
51
+ 'parallel_failed': '\u2717', // ✗
52
+ 'merge_conflict': '\u26a0', // ⚠
53
+ 'aborted': '\u25a0' // ■
54
+ };
55
+
56
+ // --- Spinner ---
57
+
58
+ const SPINNER_FRAMES = ['} } ', ' } } ', ' } }', ' } } ', '} } '];
59
+
60
+ // --- Messages ---
61
+
62
+ const MESSAGES = {
63
+ startingFlock: (count) => `Starting murmuration — ${count} feature${count === 1 ? '' : 's'} taking flight`,
64
+ landed: 'Landed',
65
+ mergedAndLanded: 'Merged and landed',
66
+ turbulence: 'Encountered turbulence',
67
+ lostFormation: 'Lost formation',
68
+ timedOut: 'Timed out \u2014 lost the flock',
69
+ flockScattering: 'Flock scattering... stopping pipelines',
70
+ takingFlight: 'Taking flight...',
71
+ murmurationComplete: '--- Murmuration Complete ---',
72
+ conflictsHeader: 'Features with turbulence (branches preserved):',
73
+ failuresHeader: 'Features that lost formation (worktrees preserved):'
74
+ };
75
+
76
+ // --- Color helper ---
77
+
78
+ function colorize(text, color, useColor) {
79
+ if (!useColor) return text;
80
+ const colors = {
81
+ green: '\x1b[32m',
82
+ red: '\x1b[31m',
83
+ yellow: '\x1b[33m',
84
+ cyan: '\x1b[36m',
85
+ reset: '\x1b[0m'
86
+ };
87
+ return `${colors[color] || ''}${text}${colors.reset}`;
88
+ }
89
+
90
+ // --- Stage formatting ---
91
+
92
+ function formatStageStart(stage, index) {
93
+ const indent = ' '.repeat(index);
94
+ const name = STAGE_NAMES[stage] || stage;
95
+ const label = STAGE_LABELS[stage] || stage;
96
+ return `${indent}${STAGE_GLYPH} ${name} \u2014 ${label}`;
97
+ }
98
+
99
+ // --- Progress bar ---
100
+
101
+ function progressBar(percent, width = 20) {
102
+ const filled = Math.round((percent / 100) * width);
103
+ const empty = width - filled;
104
+ return '[' + '}'.repeat(filled) + '\u00b7'.repeat(empty) + ']';
105
+ }
106
+
107
+ module.exports = {
108
+ BANNER,
109
+ STAGE_GLYPH,
110
+ STAGE_LABELS,
111
+ STAGE_NAMES,
112
+ STATUS_ICONS,
113
+ SPINNER_FRAMES,
114
+ MESSAGES,
115
+ colorize,
116
+ formatStageStart,
117
+ progressBar,
118
+ banner
119
+ };