the-grid-cc 1.7.1 → 1.7.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/01-SUMMARY.md +95 -0
- package/README.md +31 -13
- package/assets/terminal.svg +120 -0
- package/commands/grid/VERSION +1 -1
- package/commands/grid/help.md +7 -0
- package/commands/grid/mc.md +31 -3
- package/commands/grid/model.md +188 -0
- package/commands/grid/refine.md +4 -4
- package/package.json +1 -1
- package/tools/grid-viz/PLAN.md +235 -0
- package/tools/grid-viz/README.md +84 -0
- package/tools/grid-viz/VERIFICATION.md +197 -0
- package/tools/grid-viz/grid-viz.js +248 -0
- package/tools/grid-viz/node_modules/.package-lock.json +78 -0
- package/tools/grid-viz/node_modules/ansi-styles/index.d.ts +345 -0
- package/tools/grid-viz/node_modules/ansi-styles/index.js +163 -0
- package/tools/grid-viz/node_modules/ansi-styles/license +9 -0
- package/tools/grid-viz/node_modules/ansi-styles/package.json +56 -0
- package/tools/grid-viz/node_modules/ansi-styles/readme.md +152 -0
- package/tools/grid-viz/node_modules/chalk/index.d.ts +415 -0
- package/tools/grid-viz/node_modules/chalk/license +9 -0
- package/tools/grid-viz/node_modules/chalk/package.json +68 -0
- package/tools/grid-viz/node_modules/chalk/readme.md +341 -0
- package/tools/grid-viz/node_modules/chalk/source/index.js +229 -0
- package/tools/grid-viz/node_modules/chalk/source/templates.js +134 -0
- package/tools/grid-viz/node_modules/chalk/source/util.js +39 -0
- package/tools/grid-viz/node_modules/color-convert/CHANGELOG.md +54 -0
- package/tools/grid-viz/node_modules/color-convert/LICENSE +21 -0
- package/tools/grid-viz/node_modules/color-convert/README.md +68 -0
- package/tools/grid-viz/node_modules/color-convert/conversions.js +839 -0
- package/tools/grid-viz/node_modules/color-convert/index.js +81 -0
- package/tools/grid-viz/node_modules/color-convert/package.json +48 -0
- package/tools/grid-viz/node_modules/color-convert/route.js +97 -0
- package/tools/grid-viz/node_modules/color-name/LICENSE +8 -0
- package/tools/grid-viz/node_modules/color-name/README.md +11 -0
- package/tools/grid-viz/node_modules/color-name/index.js +152 -0
- package/tools/grid-viz/node_modules/color-name/package.json +28 -0
- package/tools/grid-viz/node_modules/has-flag/index.d.ts +39 -0
- package/tools/grid-viz/node_modules/has-flag/index.js +8 -0
- package/tools/grid-viz/node_modules/has-flag/license +9 -0
- package/tools/grid-viz/node_modules/has-flag/package.json +46 -0
- package/tools/grid-viz/node_modules/has-flag/readme.md +89 -0
- package/tools/grid-viz/node_modules/supports-color/browser.js +5 -0
- package/tools/grid-viz/node_modules/supports-color/index.js +135 -0
- package/tools/grid-viz/node_modules/supports-color/license +9 -0
- package/tools/grid-viz/node_modules/supports-color/package.json +53 -0
- package/tools/grid-viz/node_modules/supports-color/readme.md +76 -0
- package/tools/grid-viz/package-lock.json +89 -0
- package/tools/grid-viz/package.json +23 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
|
|
7
|
+
// ANSI color helpers
|
|
8
|
+
const colors = {
|
|
9
|
+
title: chalk.bold.cyan,
|
|
10
|
+
heading: chalk.bold.yellow,
|
|
11
|
+
label: chalk.gray,
|
|
12
|
+
value: chalk.white,
|
|
13
|
+
success: chalk.green,
|
|
14
|
+
warning: chalk.yellow,
|
|
15
|
+
error: chalk.red,
|
|
16
|
+
muted: chalk.dim,
|
|
17
|
+
highlight: chalk.bold.magenta,
|
|
18
|
+
progress: chalk.blue,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Find .grid directory
|
|
22
|
+
function findGridDir() {
|
|
23
|
+
let currentDir = process.cwd();
|
|
24
|
+
while (currentDir !== '/') {
|
|
25
|
+
const gridPath = path.join(currentDir, '.grid');
|
|
26
|
+
if (fs.existsSync(gridPath) && fs.statSync(gridPath).isDirectory()) {
|
|
27
|
+
return gridPath;
|
|
28
|
+
}
|
|
29
|
+
currentDir = path.dirname(currentDir);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Parse markdown file for key-value pairs
|
|
35
|
+
function parseMarkdown(content) {
|
|
36
|
+
const lines = content.split('\n');
|
|
37
|
+
const data = {};
|
|
38
|
+
let currentSection = null;
|
|
39
|
+
|
|
40
|
+
for (const line of lines) {
|
|
41
|
+
// Detect headings
|
|
42
|
+
if (line.startsWith('## ')) {
|
|
43
|
+
currentSection = line.substring(3).trim();
|
|
44
|
+
data[currentSection] = [];
|
|
45
|
+
} else if (line.startsWith('### ')) {
|
|
46
|
+
const subheading = line.substring(4).trim();
|
|
47
|
+
if (currentSection) {
|
|
48
|
+
data[currentSection].push({ type: 'subheading', value: subheading });
|
|
49
|
+
}
|
|
50
|
+
} else if (line.trim() && currentSection) {
|
|
51
|
+
data[currentSection].push({ type: 'line', value: line });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Extract progress information from STATE.md
|
|
59
|
+
function parseState(content) {
|
|
60
|
+
const state = {
|
|
61
|
+
cluster: null,
|
|
62
|
+
status: null,
|
|
63
|
+
energy: null,
|
|
64
|
+
phase: null,
|
|
65
|
+
block: null,
|
|
66
|
+
progress: null,
|
|
67
|
+
lastActivity: null,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const lines = content.split('\n');
|
|
71
|
+
for (const line of lines) {
|
|
72
|
+
if (line.startsWith('## CLUSTER:')) {
|
|
73
|
+
state.cluster = line.substring(11).trim();
|
|
74
|
+
} else if (line.startsWith('**Status:**')) {
|
|
75
|
+
state.status = line.substring(11).trim();
|
|
76
|
+
} else if (line.startsWith('**Energy:**')) {
|
|
77
|
+
state.energy = line.substring(11).trim();
|
|
78
|
+
} else if (line.includes('Phase:')) {
|
|
79
|
+
state.phase = line.split('Phase:')[1].trim();
|
|
80
|
+
} else if (line.includes('Block:')) {
|
|
81
|
+
state.block = line.split('Block:')[1].trim();
|
|
82
|
+
} else if (line.includes('Progress:')) {
|
|
83
|
+
state.progress = line.split('Progress:')[1].trim();
|
|
84
|
+
} else if (line.includes('Last activity:')) {
|
|
85
|
+
state.lastActivity = line.split('Last activity:')[1].trim();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return state;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Parse scratchpad for recent entries
|
|
93
|
+
function parseScratchpad(content) {
|
|
94
|
+
const entries = [];
|
|
95
|
+
const sections = content.split('###').filter(s => s.trim());
|
|
96
|
+
|
|
97
|
+
for (const section of sections) {
|
|
98
|
+
const lines = section.trim().split('\n');
|
|
99
|
+
if (lines.length > 0) {
|
|
100
|
+
const header = lines[0].trim();
|
|
101
|
+
const body = lines.slice(1).join('\n').trim();
|
|
102
|
+
entries.push({ header, body });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return entries.slice(-5); // Last 5 entries
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Parse learnings for count
|
|
110
|
+
function parseLearnings(content) {
|
|
111
|
+
const lines = content.split('\n');
|
|
112
|
+
let count = 0;
|
|
113
|
+
|
|
114
|
+
for (const line of lines) {
|
|
115
|
+
if (line.trim().startsWith('-') || line.trim().startsWith('*')) {
|
|
116
|
+
count++;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return count;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Render progress bar
|
|
124
|
+
function renderProgressBar(percentage, width = 40) {
|
|
125
|
+
const filled = Math.round((percentage / 100) * width);
|
|
126
|
+
const empty = width - filled;
|
|
127
|
+
const bar = '█'.repeat(filled) + '░'.repeat(empty);
|
|
128
|
+
return `${colors.progress(bar)} ${colors.value(percentage + '%')}`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Main visualization
|
|
132
|
+
function visualize() {
|
|
133
|
+
console.log('\n' + colors.title('═'.repeat(80)));
|
|
134
|
+
console.log(colors.title(' THE GRID - State Visualization'));
|
|
135
|
+
console.log(colors.title('═'.repeat(80)) + '\n');
|
|
136
|
+
|
|
137
|
+
const gridDir = findGridDir();
|
|
138
|
+
|
|
139
|
+
if (!gridDir) {
|
|
140
|
+
console.log(colors.error('✗ No .grid directory found in current path or parent directories\n'));
|
|
141
|
+
console.log(colors.muted(' Run this command from within a Grid-initialized project\n'));
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
console.log(colors.label('Grid directory: ') + colors.muted(gridDir) + '\n');
|
|
146
|
+
|
|
147
|
+
// Read STATE.md
|
|
148
|
+
const statePath = path.join(gridDir, 'STATE.md');
|
|
149
|
+
if (!fs.existsSync(statePath)) {
|
|
150
|
+
console.log(colors.warning('⚠ STATE.md not found\n'));
|
|
151
|
+
} else {
|
|
152
|
+
const stateContent = fs.readFileSync(statePath, 'utf8');
|
|
153
|
+
const state = parseState(stateContent);
|
|
154
|
+
|
|
155
|
+
console.log(colors.heading('CLUSTER STATUS'));
|
|
156
|
+
console.log(colors.label(' Name: ') + colors.value(state.cluster || 'Unknown'));
|
|
157
|
+
console.log(colors.label(' Status: ') + (state.status === 'COMPLETE' ? colors.success(state.status) : colors.warning(state.status || 'Unknown')));
|
|
158
|
+
console.log(colors.label(' Energy: ') + colors.highlight(state.energy || 'N/A'));
|
|
159
|
+
|
|
160
|
+
if (state.phase) {
|
|
161
|
+
console.log(colors.label(' Phase: ') + colors.value(state.phase));
|
|
162
|
+
}
|
|
163
|
+
if (state.block) {
|
|
164
|
+
console.log(colors.label(' Block: ') + colors.value(state.block));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Progress bar
|
|
168
|
+
if (state.progress) {
|
|
169
|
+
const progressMatch = state.progress.match(/(\d+)%/);
|
|
170
|
+
if (progressMatch) {
|
|
171
|
+
const percentage = parseInt(progressMatch[1]);
|
|
172
|
+
console.log(colors.label(' Progress: ') + renderProgressBar(percentage));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (state.lastActivity) {
|
|
177
|
+
console.log(colors.label(' Last: ') + colors.muted(state.lastActivity));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
console.log('');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Read SCRATCHPAD.md
|
|
184
|
+
const scratchpadPath = path.join(gridDir, 'SCRATCHPAD.md');
|
|
185
|
+
if (fs.existsSync(scratchpadPath)) {
|
|
186
|
+
const scratchpadContent = fs.readFileSync(scratchpadPath, 'utf8');
|
|
187
|
+
const entries = parseScratchpad(scratchpadContent);
|
|
188
|
+
|
|
189
|
+
if (entries.length > 0) {
|
|
190
|
+
console.log(colors.heading('RECENT SCRATCHPAD ENTRIES'));
|
|
191
|
+
entries.forEach((entry, index) => {
|
|
192
|
+
console.log(colors.label(` [${entries.length - index}] `) + colors.value(entry.header));
|
|
193
|
+
if (entry.body) {
|
|
194
|
+
const preview = entry.body.substring(0, 60);
|
|
195
|
+
console.log(colors.muted(` ${preview}${entry.body.length > 60 ? '...' : ''}`));
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
console.log('');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Read LEARNINGS.md
|
|
203
|
+
const learningsPath = path.join(gridDir, 'LEARNINGS.md');
|
|
204
|
+
if (fs.existsSync(learningsPath)) {
|
|
205
|
+
const learningsContent = fs.readFileSync(learningsPath, 'utf8');
|
|
206
|
+
const learningCount = parseLearnings(learningsContent);
|
|
207
|
+
|
|
208
|
+
console.log(colors.heading('WARMTH'));
|
|
209
|
+
console.log(colors.label(' Learnings: ') + colors.highlight(learningCount + ' patterns captured'));
|
|
210
|
+
console.log('');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Read BLOCKERS.md
|
|
214
|
+
const blockersPath = path.join(gridDir, 'BLOCKERS.md');
|
|
215
|
+
if (fs.existsSync(blockersPath)) {
|
|
216
|
+
const blockersContent = fs.readFileSync(blockersPath, 'utf8');
|
|
217
|
+
const blockerLines = blockersContent.split('\n').filter(l => l.trim().startsWith('-') || l.trim().startsWith('*'));
|
|
218
|
+
|
|
219
|
+
if (blockerLines.length > 0) {
|
|
220
|
+
console.log(colors.heading('ACTIVE BLOCKERS'));
|
|
221
|
+
blockerLines.slice(0, 5).forEach(blocker => {
|
|
222
|
+
console.log(colors.error(' ✗ ') + colors.value(blocker.replace(/^[-*]\s*/, '')));
|
|
223
|
+
});
|
|
224
|
+
console.log('');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Read DECISIONS.md
|
|
229
|
+
const decisionsPath = path.join(gridDir, 'DECISIONS.md');
|
|
230
|
+
if (fs.existsSync(decisionsPath)) {
|
|
231
|
+
const decisionsContent = fs.readFileSync(decisionsPath, 'utf8');
|
|
232
|
+
const decisionLines = decisionsContent.split('\n').filter(l => l.trim().startsWith('-') || l.trim().startsWith('*'));
|
|
233
|
+
|
|
234
|
+
if (decisionLines.length > 0) {
|
|
235
|
+
console.log(colors.heading('PENDING DECISIONS'));
|
|
236
|
+
decisionLines.slice(0, 3).forEach(decision => {
|
|
237
|
+
console.log(colors.warning(' ? ') + colors.value(decision.replace(/^[-*]\s*/, '')));
|
|
238
|
+
});
|
|
239
|
+
console.log('');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
console.log(colors.title('═'.repeat(80)));
|
|
244
|
+
console.log(colors.muted(' End of Line.\n'));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Run
|
|
248
|
+
visualize();
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "grid-viz",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"node_modules/ansi-styles": {
|
|
8
|
+
"version": "4.3.0",
|
|
9
|
+
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
|
10
|
+
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"color-convert": "^2.0.1"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=8"
|
|
17
|
+
},
|
|
18
|
+
"funding": {
|
|
19
|
+
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"node_modules/chalk": {
|
|
23
|
+
"version": "4.1.2",
|
|
24
|
+
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
|
25
|
+
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"ansi-styles": "^4.1.0",
|
|
29
|
+
"supports-color": "^7.1.0"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=10"
|
|
33
|
+
},
|
|
34
|
+
"funding": {
|
|
35
|
+
"url": "https://github.com/chalk/chalk?sponsor=1"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"node_modules/color-convert": {
|
|
39
|
+
"version": "2.0.1",
|
|
40
|
+
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
|
41
|
+
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"color-name": "~1.1.4"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=7.0.0"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"node_modules/color-name": {
|
|
51
|
+
"version": "1.1.4",
|
|
52
|
+
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
|
53
|
+
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
|
54
|
+
"license": "MIT"
|
|
55
|
+
},
|
|
56
|
+
"node_modules/has-flag": {
|
|
57
|
+
"version": "4.0.0",
|
|
58
|
+
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
|
59
|
+
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=8"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"node_modules/supports-color": {
|
|
66
|
+
"version": "7.2.0",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
|
68
|
+
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"has-flag": "^4.0.0"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=8"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
declare type CSSColor =
|
|
2
|
+
| 'aliceblue'
|
|
3
|
+
| 'antiquewhite'
|
|
4
|
+
| 'aqua'
|
|
5
|
+
| 'aquamarine'
|
|
6
|
+
| 'azure'
|
|
7
|
+
| 'beige'
|
|
8
|
+
| 'bisque'
|
|
9
|
+
| 'black'
|
|
10
|
+
| 'blanchedalmond'
|
|
11
|
+
| 'blue'
|
|
12
|
+
| 'blueviolet'
|
|
13
|
+
| 'brown'
|
|
14
|
+
| 'burlywood'
|
|
15
|
+
| 'cadetblue'
|
|
16
|
+
| 'chartreuse'
|
|
17
|
+
| 'chocolate'
|
|
18
|
+
| 'coral'
|
|
19
|
+
| 'cornflowerblue'
|
|
20
|
+
| 'cornsilk'
|
|
21
|
+
| 'crimson'
|
|
22
|
+
| 'cyan'
|
|
23
|
+
| 'darkblue'
|
|
24
|
+
| 'darkcyan'
|
|
25
|
+
| 'darkgoldenrod'
|
|
26
|
+
| 'darkgray'
|
|
27
|
+
| 'darkgreen'
|
|
28
|
+
| 'darkgrey'
|
|
29
|
+
| 'darkkhaki'
|
|
30
|
+
| 'darkmagenta'
|
|
31
|
+
| 'darkolivegreen'
|
|
32
|
+
| 'darkorange'
|
|
33
|
+
| 'darkorchid'
|
|
34
|
+
| 'darkred'
|
|
35
|
+
| 'darksalmon'
|
|
36
|
+
| 'darkseagreen'
|
|
37
|
+
| 'darkslateblue'
|
|
38
|
+
| 'darkslategray'
|
|
39
|
+
| 'darkslategrey'
|
|
40
|
+
| 'darkturquoise'
|
|
41
|
+
| 'darkviolet'
|
|
42
|
+
| 'deeppink'
|
|
43
|
+
| 'deepskyblue'
|
|
44
|
+
| 'dimgray'
|
|
45
|
+
| 'dimgrey'
|
|
46
|
+
| 'dodgerblue'
|
|
47
|
+
| 'firebrick'
|
|
48
|
+
| 'floralwhite'
|
|
49
|
+
| 'forestgreen'
|
|
50
|
+
| 'fuchsia'
|
|
51
|
+
| 'gainsboro'
|
|
52
|
+
| 'ghostwhite'
|
|
53
|
+
| 'gold'
|
|
54
|
+
| 'goldenrod'
|
|
55
|
+
| 'gray'
|
|
56
|
+
| 'green'
|
|
57
|
+
| 'greenyellow'
|
|
58
|
+
| 'grey'
|
|
59
|
+
| 'honeydew'
|
|
60
|
+
| 'hotpink'
|
|
61
|
+
| 'indianred'
|
|
62
|
+
| 'indigo'
|
|
63
|
+
| 'ivory'
|
|
64
|
+
| 'khaki'
|
|
65
|
+
| 'lavender'
|
|
66
|
+
| 'lavenderblush'
|
|
67
|
+
| 'lawngreen'
|
|
68
|
+
| 'lemonchiffon'
|
|
69
|
+
| 'lightblue'
|
|
70
|
+
| 'lightcoral'
|
|
71
|
+
| 'lightcyan'
|
|
72
|
+
| 'lightgoldenrodyellow'
|
|
73
|
+
| 'lightgray'
|
|
74
|
+
| 'lightgreen'
|
|
75
|
+
| 'lightgrey'
|
|
76
|
+
| 'lightpink'
|
|
77
|
+
| 'lightsalmon'
|
|
78
|
+
| 'lightseagreen'
|
|
79
|
+
| 'lightskyblue'
|
|
80
|
+
| 'lightslategray'
|
|
81
|
+
| 'lightslategrey'
|
|
82
|
+
| 'lightsteelblue'
|
|
83
|
+
| 'lightyellow'
|
|
84
|
+
| 'lime'
|
|
85
|
+
| 'limegreen'
|
|
86
|
+
| 'linen'
|
|
87
|
+
| 'magenta'
|
|
88
|
+
| 'maroon'
|
|
89
|
+
| 'mediumaquamarine'
|
|
90
|
+
| 'mediumblue'
|
|
91
|
+
| 'mediumorchid'
|
|
92
|
+
| 'mediumpurple'
|
|
93
|
+
| 'mediumseagreen'
|
|
94
|
+
| 'mediumslateblue'
|
|
95
|
+
| 'mediumspringgreen'
|
|
96
|
+
| 'mediumturquoise'
|
|
97
|
+
| 'mediumvioletred'
|
|
98
|
+
| 'midnightblue'
|
|
99
|
+
| 'mintcream'
|
|
100
|
+
| 'mistyrose'
|
|
101
|
+
| 'moccasin'
|
|
102
|
+
| 'navajowhite'
|
|
103
|
+
| 'navy'
|
|
104
|
+
| 'oldlace'
|
|
105
|
+
| 'olive'
|
|
106
|
+
| 'olivedrab'
|
|
107
|
+
| 'orange'
|
|
108
|
+
| 'orangered'
|
|
109
|
+
| 'orchid'
|
|
110
|
+
| 'palegoldenrod'
|
|
111
|
+
| 'palegreen'
|
|
112
|
+
| 'paleturquoise'
|
|
113
|
+
| 'palevioletred'
|
|
114
|
+
| 'papayawhip'
|
|
115
|
+
| 'peachpuff'
|
|
116
|
+
| 'peru'
|
|
117
|
+
| 'pink'
|
|
118
|
+
| 'plum'
|
|
119
|
+
| 'powderblue'
|
|
120
|
+
| 'purple'
|
|
121
|
+
| 'rebeccapurple'
|
|
122
|
+
| 'red'
|
|
123
|
+
| 'rosybrown'
|
|
124
|
+
| 'royalblue'
|
|
125
|
+
| 'saddlebrown'
|
|
126
|
+
| 'salmon'
|
|
127
|
+
| 'sandybrown'
|
|
128
|
+
| 'seagreen'
|
|
129
|
+
| 'seashell'
|
|
130
|
+
| 'sienna'
|
|
131
|
+
| 'silver'
|
|
132
|
+
| 'skyblue'
|
|
133
|
+
| 'slateblue'
|
|
134
|
+
| 'slategray'
|
|
135
|
+
| 'slategrey'
|
|
136
|
+
| 'snow'
|
|
137
|
+
| 'springgreen'
|
|
138
|
+
| 'steelblue'
|
|
139
|
+
| 'tan'
|
|
140
|
+
| 'teal'
|
|
141
|
+
| 'thistle'
|
|
142
|
+
| 'tomato'
|
|
143
|
+
| 'turquoise'
|
|
144
|
+
| 'violet'
|
|
145
|
+
| 'wheat'
|
|
146
|
+
| 'white'
|
|
147
|
+
| 'whitesmoke'
|
|
148
|
+
| 'yellow'
|
|
149
|
+
| 'yellowgreen';
|
|
150
|
+
|
|
151
|
+
declare namespace ansiStyles {
|
|
152
|
+
interface ColorConvert {
|
|
153
|
+
/**
|
|
154
|
+
The RGB color space.
|
|
155
|
+
|
|
156
|
+
@param red - (`0`-`255`)
|
|
157
|
+
@param green - (`0`-`255`)
|
|
158
|
+
@param blue - (`0`-`255`)
|
|
159
|
+
*/
|
|
160
|
+
rgb(red: number, green: number, blue: number): string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
The RGB HEX color space.
|
|
164
|
+
|
|
165
|
+
@param hex - A hexadecimal string containing RGB data.
|
|
166
|
+
*/
|
|
167
|
+
hex(hex: string): string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
@param keyword - A CSS color name.
|
|
171
|
+
*/
|
|
172
|
+
keyword(keyword: CSSColor): string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
The HSL color space.
|
|
176
|
+
|
|
177
|
+
@param hue - (`0`-`360`)
|
|
178
|
+
@param saturation - (`0`-`100`)
|
|
179
|
+
@param lightness - (`0`-`100`)
|
|
180
|
+
*/
|
|
181
|
+
hsl(hue: number, saturation: number, lightness: number): string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
The HSV color space.
|
|
185
|
+
|
|
186
|
+
@param hue - (`0`-`360`)
|
|
187
|
+
@param saturation - (`0`-`100`)
|
|
188
|
+
@param value - (`0`-`100`)
|
|
189
|
+
*/
|
|
190
|
+
hsv(hue: number, saturation: number, value: number): string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
The HSV color space.
|
|
194
|
+
|
|
195
|
+
@param hue - (`0`-`360`)
|
|
196
|
+
@param whiteness - (`0`-`100`)
|
|
197
|
+
@param blackness - (`0`-`100`)
|
|
198
|
+
*/
|
|
199
|
+
hwb(hue: number, whiteness: number, blackness: number): string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
|
|
203
|
+
*/
|
|
204
|
+
ansi(ansi: number): string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
|
208
|
+
*/
|
|
209
|
+
ansi256(ansi: number): string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
interface CSPair {
|
|
213
|
+
/**
|
|
214
|
+
The ANSI terminal control sequence for starting this style.
|
|
215
|
+
*/
|
|
216
|
+
readonly open: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
The ANSI terminal control sequence for ending this style.
|
|
220
|
+
*/
|
|
221
|
+
readonly close: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface ColorBase {
|
|
225
|
+
readonly ansi: ColorConvert;
|
|
226
|
+
readonly ansi256: ColorConvert;
|
|
227
|
+
readonly ansi16m: ColorConvert;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
The ANSI terminal control sequence for ending this color.
|
|
231
|
+
*/
|
|
232
|
+
readonly close: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
interface Modifier {
|
|
236
|
+
/**
|
|
237
|
+
Resets the current color chain.
|
|
238
|
+
*/
|
|
239
|
+
readonly reset: CSPair;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
Make text bold.
|
|
243
|
+
*/
|
|
244
|
+
readonly bold: CSPair;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
Emitting only a small amount of light.
|
|
248
|
+
*/
|
|
249
|
+
readonly dim: CSPair;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
Make text italic. (Not widely supported)
|
|
253
|
+
*/
|
|
254
|
+
readonly italic: CSPair;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
Make text underline. (Not widely supported)
|
|
258
|
+
*/
|
|
259
|
+
readonly underline: CSPair;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
Inverse background and foreground colors.
|
|
263
|
+
*/
|
|
264
|
+
readonly inverse: CSPair;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
Prints the text, but makes it invisible.
|
|
268
|
+
*/
|
|
269
|
+
readonly hidden: CSPair;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
Puts a horizontal line through the center of the text. (Not widely supported)
|
|
273
|
+
*/
|
|
274
|
+
readonly strikethrough: CSPair;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
interface ForegroundColor {
|
|
278
|
+
readonly black: CSPair;
|
|
279
|
+
readonly red: CSPair;
|
|
280
|
+
readonly green: CSPair;
|
|
281
|
+
readonly yellow: CSPair;
|
|
282
|
+
readonly blue: CSPair;
|
|
283
|
+
readonly cyan: CSPair;
|
|
284
|
+
readonly magenta: CSPair;
|
|
285
|
+
readonly white: CSPair;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
Alias for `blackBright`.
|
|
289
|
+
*/
|
|
290
|
+
readonly gray: CSPair;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
Alias for `blackBright`.
|
|
294
|
+
*/
|
|
295
|
+
readonly grey: CSPair;
|
|
296
|
+
|
|
297
|
+
readonly blackBright: CSPair;
|
|
298
|
+
readonly redBright: CSPair;
|
|
299
|
+
readonly greenBright: CSPair;
|
|
300
|
+
readonly yellowBright: CSPair;
|
|
301
|
+
readonly blueBright: CSPair;
|
|
302
|
+
readonly cyanBright: CSPair;
|
|
303
|
+
readonly magentaBright: CSPair;
|
|
304
|
+
readonly whiteBright: CSPair;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface BackgroundColor {
|
|
308
|
+
readonly bgBlack: CSPair;
|
|
309
|
+
readonly bgRed: CSPair;
|
|
310
|
+
readonly bgGreen: CSPair;
|
|
311
|
+
readonly bgYellow: CSPair;
|
|
312
|
+
readonly bgBlue: CSPair;
|
|
313
|
+
readonly bgCyan: CSPair;
|
|
314
|
+
readonly bgMagenta: CSPair;
|
|
315
|
+
readonly bgWhite: CSPair;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
Alias for `bgBlackBright`.
|
|
319
|
+
*/
|
|
320
|
+
readonly bgGray: CSPair;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
Alias for `bgBlackBright`.
|
|
324
|
+
*/
|
|
325
|
+
readonly bgGrey: CSPair;
|
|
326
|
+
|
|
327
|
+
readonly bgBlackBright: CSPair;
|
|
328
|
+
readonly bgRedBright: CSPair;
|
|
329
|
+
readonly bgGreenBright: CSPair;
|
|
330
|
+
readonly bgYellowBright: CSPair;
|
|
331
|
+
readonly bgBlueBright: CSPair;
|
|
332
|
+
readonly bgCyanBright: CSPair;
|
|
333
|
+
readonly bgMagentaBright: CSPair;
|
|
334
|
+
readonly bgWhiteBright: CSPair;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare const ansiStyles: {
|
|
339
|
+
readonly modifier: ansiStyles.Modifier;
|
|
340
|
+
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
|
|
341
|
+
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
|
|
342
|
+
readonly codes: ReadonlyMap<number, number>;
|
|
343
|
+
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
|
|
344
|
+
|
|
345
|
+
export = ansiStyles;
|