@mudah-cli/ui 0.1.0 → 0.2.0
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.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/output.d.ts +48 -2
- package/dist/output.js +139 -12
- package/dist/output.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { bold, dim, italic, paint, paintBg, stripAnsi, underline, visibleLength, } from './colors.js';
|
|
2
|
-
export { Output, type OutputOptions } from './output.js';
|
|
2
|
+
export { Output, type OutputEvent, type OutputMode, type OutputOptions } from './output.js';
|
|
3
3
|
export { renderMarkdown, type RenderMarkdownOptions } from './markdown.js';
|
|
4
4
|
export { renderPanel, type RenderPanelOptions } from './panel.js';
|
|
5
5
|
export { renderTable, type RenderTableOptions, type TableColumn } from './table.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAyD,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAA2B,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,WAAW,EAA6C,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAgC,MAAM,YAAY,CAAC"}
|
package/dist/output.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ColorLevel } from '@mudah-cli/terminal';
|
|
2
2
|
import type { Theme } from './theme.js';
|
|
3
3
|
import { type TableColumn } from './table.js';
|
|
4
|
+
export type OutputMode = 'styled' | 'plain' | 'json';
|
|
4
5
|
export interface OutputOptions {
|
|
5
6
|
stream?: {
|
|
6
7
|
write(data: string): unknown;
|
|
@@ -13,10 +14,26 @@ export interface OutputOptions {
|
|
|
13
14
|
unicode: boolean;
|
|
14
15
|
/** OSC 9 notifications supported? */
|
|
15
16
|
osc9?: boolean;
|
|
17
|
+
/** Rendering mode. Default `styled` (colors when level > 0). */
|
|
18
|
+
mode?: OutputMode;
|
|
19
|
+
}
|
|
20
|
+
/** A structured result event (used by JSON mode and the result envelope). */
|
|
21
|
+
export interface OutputEvent {
|
|
22
|
+
readonly kind: 'info' | 'success' | 'error' | 'warn' | 'data';
|
|
23
|
+
readonly message: string;
|
|
24
|
+
readonly data?: unknown;
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* The styled output surface. Every framework message flows through here so
|
|
19
|
-
* theming, color level, unicode,
|
|
28
|
+
* theming, color level, unicode, stream selection — and output *mode* — stay
|
|
29
|
+
* consistent.
|
|
30
|
+
*
|
|
31
|
+
* Modes:
|
|
32
|
+
* - `styled`: colors/glyphs when the terminal allows; default.
|
|
33
|
+
* - `plain`: no ANSI at all (still human-readable). Good for logs.
|
|
34
|
+
* - `json`: every primitive becomes one machine-readable JSON line on
|
|
35
|
+
* stdout; use {@link emit} for structured payloads and
|
|
36
|
+
* {@link jsonEnvelope} for a single `{ok, results|error}` document.
|
|
20
37
|
*/
|
|
21
38
|
export declare class Output {
|
|
22
39
|
private out;
|
|
@@ -25,6 +42,8 @@ export declare class Output {
|
|
|
25
42
|
private readonly level;
|
|
26
43
|
private readonly unicode;
|
|
27
44
|
private readonly osc9;
|
|
45
|
+
private modeInternal;
|
|
46
|
+
private readonly events;
|
|
28
47
|
constructor(options: OutputOptions);
|
|
29
48
|
/** Replace the underlying streams (used by test harnesses). */
|
|
30
49
|
redirect(stream: {
|
|
@@ -32,8 +51,32 @@ export declare class Output {
|
|
|
32
51
|
}, errorStream: {
|
|
33
52
|
write(data: string): unknown;
|
|
34
53
|
}): void;
|
|
54
|
+
get mode(): OutputMode;
|
|
55
|
+
get isMachineReadable(): boolean;
|
|
56
|
+
/** Switch rendering mode mid-run (e.g. after parsing global flags). */
|
|
57
|
+
setMode(mode: OutputMode): void;
|
|
58
|
+
private levelForcedZero;
|
|
59
|
+
private effectiveLevel;
|
|
35
60
|
get themeName(): string;
|
|
36
61
|
get colorLevel(): ColorLevel;
|
|
62
|
+
/** Record + (in json mode) write a structured data payload. */
|
|
63
|
+
emit(kind: OutputEvent['kind'], message: string, data?: unknown): void;
|
|
64
|
+
/** All events recorded this run (for envelopes/tests). */
|
|
65
|
+
takeEvents(): OutputEvent[];
|
|
66
|
+
/**
|
|
67
|
+
* The full-run JSON envelope: `{ ok, results }` or
|
|
68
|
+
* `{ ok: false, error: {...} }`. Extra contextual fields (command, help,
|
|
69
|
+
* version, commands, duration) are merged at the top level.
|
|
70
|
+
*/
|
|
71
|
+
jsonEnvelope(options: {
|
|
72
|
+
ok: boolean;
|
|
73
|
+
exitCode: number;
|
|
74
|
+
error?: {
|
|
75
|
+
message: string;
|
|
76
|
+
hint?: string;
|
|
77
|
+
usage?: string;
|
|
78
|
+
};
|
|
79
|
+
} & Record<string, unknown>): string;
|
|
37
80
|
raw(message: string): void;
|
|
38
81
|
info(message: string): void;
|
|
39
82
|
success(message: string): void;
|
|
@@ -49,9 +92,12 @@ export declare class Output {
|
|
|
49
92
|
table(columns: TableColumn[], rows: string[][]): void;
|
|
50
93
|
panel(title: string | undefined, body: string[], width?: number): void;
|
|
51
94
|
markdown(text: string): void;
|
|
95
|
+
/** Record an event and stream it as a JSON line (json mode only). */
|
|
96
|
+
private writeJsonLine;
|
|
52
97
|
/**
|
|
53
98
|
* Desktop notification via OSC 9 (Ghostty/WezTerm). When unsupported,
|
|
54
|
-
* degrades to a styled status line on stderr.
|
|
99
|
+
* degrades to a styled status line on stderr. In json mode, becomes a
|
|
100
|
+
* data event.
|
|
55
101
|
*/
|
|
56
102
|
notification(title: string, message: string): void;
|
|
57
103
|
private mark;
|
package/dist/output.js
CHANGED
|
@@ -5,7 +5,15 @@ import { renderTable } from './table.js';
|
|
|
5
5
|
import { renderMarkdown } from './markdown.js';
|
|
6
6
|
/**
|
|
7
7
|
* The styled output surface. Every framework message flows through here so
|
|
8
|
-
* theming, color level, unicode,
|
|
8
|
+
* theming, color level, unicode, stream selection — and output *mode* — stay
|
|
9
|
+
* consistent.
|
|
10
|
+
*
|
|
11
|
+
* Modes:
|
|
12
|
+
* - `styled`: colors/glyphs when the terminal allows; default.
|
|
13
|
+
* - `plain`: no ANSI at all (still human-readable). Good for logs.
|
|
14
|
+
* - `json`: every primitive becomes one machine-readable JSON line on
|
|
15
|
+
* stdout; use {@link emit} for structured payloads and
|
|
16
|
+
* {@link jsonEnvelope} for a single `{ok, results|error}` document.
|
|
9
17
|
*/
|
|
10
18
|
export class Output {
|
|
11
19
|
out;
|
|
@@ -14,6 +22,8 @@ export class Output {
|
|
|
14
22
|
level;
|
|
15
23
|
unicode;
|
|
16
24
|
osc9;
|
|
25
|
+
modeInternal;
|
|
26
|
+
events = [];
|
|
17
27
|
constructor(options) {
|
|
18
28
|
this.out = options.stream ?? process.stdout;
|
|
19
29
|
this.err = options.errorStream ?? process.stderr;
|
|
@@ -21,81 +31,198 @@ export class Output {
|
|
|
21
31
|
this.level = options.colorLevel;
|
|
22
32
|
this.unicode = options.unicode;
|
|
23
33
|
this.osc9 = options.osc9 ?? false;
|
|
34
|
+
this.modeInternal = options.mode ?? 'styled';
|
|
24
35
|
}
|
|
25
36
|
/** Replace the underlying streams (used by test harnesses). */
|
|
26
37
|
redirect(stream, errorStream) {
|
|
27
38
|
this.out = stream;
|
|
28
39
|
this.err = errorStream;
|
|
29
40
|
}
|
|
41
|
+
get mode() {
|
|
42
|
+
return this.modeInternal;
|
|
43
|
+
}
|
|
44
|
+
get isMachineReadable() {
|
|
45
|
+
return this.modeInternal === 'json';
|
|
46
|
+
}
|
|
47
|
+
/** Switch rendering mode mid-run (e.g. after parsing global flags). */
|
|
48
|
+
setMode(mode) {
|
|
49
|
+
this.modeInternal = mode;
|
|
50
|
+
if (mode !== 'styled') {
|
|
51
|
+
// Plain/json ignore color levels entirely.
|
|
52
|
+
this.levelForcedZero = true;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.levelForcedZero = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
levelForcedZero = false;
|
|
59
|
+
effectiveLevel() {
|
|
60
|
+
return this.levelForcedZero ? 0 : this.level;
|
|
61
|
+
}
|
|
30
62
|
get themeName() {
|
|
31
63
|
return this.theme.name;
|
|
32
64
|
}
|
|
33
65
|
get colorLevel() {
|
|
34
|
-
return this.
|
|
66
|
+
return this.effectiveLevel();
|
|
67
|
+
}
|
|
68
|
+
/** Record + (in json mode) write a structured data payload. */
|
|
69
|
+
emit(kind, message, data) {
|
|
70
|
+
const event = kind === 'data' && data !== undefined ? { kind, message, data } : { kind, message };
|
|
71
|
+
this.events.push(event);
|
|
72
|
+
if (this.isMachineReadable) {
|
|
73
|
+
this.out.write(JSON.stringify(event) + '\n');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** All events recorded this run (for envelopes/tests). */
|
|
77
|
+
takeEvents() {
|
|
78
|
+
return this.events.splice(0);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The full-run JSON envelope: `{ ok, results }` or
|
|
82
|
+
* `{ ok: false, error: {...} }`. Extra contextual fields (command, help,
|
|
83
|
+
* version, commands, duration) are merged at the top level.
|
|
84
|
+
*/
|
|
85
|
+
jsonEnvelope(options) {
|
|
86
|
+
const { ok, exitCode, error, ...extra } = options;
|
|
87
|
+
if (ok) {
|
|
88
|
+
return JSON.stringify({
|
|
89
|
+
ok: true,
|
|
90
|
+
exitCode,
|
|
91
|
+
...extra,
|
|
92
|
+
...(this.events.length > 0 ? { results: this.events } : {}),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return JSON.stringify({
|
|
96
|
+
ok: false,
|
|
97
|
+
exitCode,
|
|
98
|
+
...extra,
|
|
99
|
+
error: error ?? { message: 'Unknown error' },
|
|
100
|
+
});
|
|
35
101
|
}
|
|
36
102
|
raw(message) {
|
|
37
103
|
this.out.write(message + '\n');
|
|
38
104
|
}
|
|
39
105
|
info(message) {
|
|
106
|
+
if (this.isMachineReadable) {
|
|
107
|
+
this.writeJsonLine('info', message);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
40
110
|
this.out.write(this.paint('info', message) + '\n');
|
|
41
111
|
}
|
|
42
112
|
success(message) {
|
|
113
|
+
if (this.isMachineReadable) {
|
|
114
|
+
this.writeJsonLine('success', message);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
43
117
|
this.out.write(this.mark('success') + ' ' + this.paint('success', message) + '\n');
|
|
44
118
|
}
|
|
45
119
|
error(message) {
|
|
120
|
+
if (this.isMachineReadable) {
|
|
121
|
+
this.err.write(JSON.stringify({ kind: 'error', message }) + '\n');
|
|
122
|
+
this.events.push({ kind: 'error', message });
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
46
125
|
this.err.write(this.mark('error') + ' ' + this.paint('error', message) + '\n');
|
|
47
126
|
}
|
|
48
127
|
warn(message) {
|
|
128
|
+
if (this.isMachineReadable) {
|
|
129
|
+
this.err.write(JSON.stringify({ kind: 'warn', message }) + '\n');
|
|
130
|
+
this.events.push({ kind: 'warn', message });
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
49
133
|
this.err.write(this.mark('warn') + ' ' + this.paint('warn', message) + '\n');
|
|
50
134
|
}
|
|
51
135
|
muted(message) {
|
|
52
|
-
|
|
136
|
+
if (this.isMachineReadable)
|
|
137
|
+
return; // human-only decoration
|
|
138
|
+
this.out.write(dim(this.paint('muted', message), this.effectiveLevel()) + '\n');
|
|
53
139
|
}
|
|
54
140
|
/** A muted hint line on the error stream (used alongside error output). */
|
|
55
141
|
hint(message) {
|
|
56
|
-
|
|
142
|
+
if (this.isMachineReadable)
|
|
143
|
+
return;
|
|
144
|
+
this.err.write(dim(this.paint('muted', `Hint: ${message}`), this.effectiveLevel()) + '\n');
|
|
57
145
|
}
|
|
58
146
|
section(title) {
|
|
59
|
-
|
|
147
|
+
if (this.isMachineReadable)
|
|
148
|
+
return;
|
|
149
|
+
this.out.write('\n' + underline(bold(this.paint('accent', title), this.effectiveLevel()), this.effectiveLevel()) + '\n');
|
|
60
150
|
}
|
|
61
151
|
bullet(message) {
|
|
152
|
+
if (this.isMachineReadable)
|
|
153
|
+
return;
|
|
62
154
|
this.out.write(` ${this.paint('muted', this.unicode ? '•' : '*')} ${message}\n`);
|
|
63
155
|
}
|
|
64
156
|
keyValue(label, value) {
|
|
65
|
-
|
|
157
|
+
if (this.isMachineReadable) {
|
|
158
|
+
this.emit('data', label, value);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const labelPart = bold(this.paint('muted', label), this.effectiveLevel());
|
|
66
162
|
this.out.write(` ${labelPart.padEnd(24)} ${value}\n`);
|
|
67
163
|
}
|
|
68
164
|
line() {
|
|
165
|
+
if (this.isMachineReadable)
|
|
166
|
+
return;
|
|
69
167
|
const ch = this.unicode ? '─' : '-';
|
|
70
168
|
this.out.write(this.paint('border', ch.repeat(60)) + '\n');
|
|
71
169
|
}
|
|
72
170
|
table(columns, rows) {
|
|
73
|
-
|
|
171
|
+
if (this.isMachineReadable) {
|
|
172
|
+
// Render rows as data events keyed by header.
|
|
173
|
+
const headers = columns.map((c) => c.header);
|
|
174
|
+
for (const row of rows) {
|
|
175
|
+
const record = {};
|
|
176
|
+
headers.forEach((header, i) => {
|
|
177
|
+
record[header] = row[i] ?? '';
|
|
178
|
+
});
|
|
179
|
+
this.emit('data', 'table-row', record);
|
|
180
|
+
}
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
this.out.write(renderTable(columns, rows, { level: this.effectiveLevel(), unicode: this.unicode }) + '\n');
|
|
74
184
|
}
|
|
75
185
|
panel(title, body, width) {
|
|
76
|
-
|
|
186
|
+
if (this.isMachineReadable)
|
|
187
|
+
return;
|
|
188
|
+
this.out.write(renderPanel(title, body, { level: this.effectiveLevel(), unicode: this.unicode, width }) + '\n');
|
|
77
189
|
}
|
|
78
190
|
markdown(text) {
|
|
79
|
-
|
|
191
|
+
if (this.isMachineReadable) {
|
|
192
|
+
this.emit('data', 'markdown', text);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this.out.write(renderMarkdown(text, { level: this.effectiveLevel(), theme: this.theme }) + '\n');
|
|
196
|
+
}
|
|
197
|
+
/** Record an event and stream it as a JSON line (json mode only). */
|
|
198
|
+
writeJsonLine(kind, message, data) {
|
|
199
|
+
const event = data !== undefined ? { kind, message, data } : { kind, message };
|
|
200
|
+
this.events.push(event);
|
|
201
|
+
this.out.write(JSON.stringify(event) + '\n');
|
|
80
202
|
}
|
|
81
203
|
/**
|
|
82
204
|
* Desktop notification via OSC 9 (Ghostty/WezTerm). When unsupported,
|
|
83
|
-
* degrades to a styled status line on stderr.
|
|
205
|
+
* degrades to a styled status line on stderr. In json mode, becomes a
|
|
206
|
+
* data event.
|
|
84
207
|
*/
|
|
85
208
|
notification(title, message) {
|
|
209
|
+
if (this.isMachineReadable) {
|
|
210
|
+
this.emit('data', 'notification', { title, message });
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
86
213
|
if (this.osc9) {
|
|
87
214
|
this.err.write(`\x1b]9;${title}\x1f${message}\x07`);
|
|
88
215
|
this.err.write(`\x1b]777;notify;${title};${message}\x07`);
|
|
89
216
|
return;
|
|
90
217
|
}
|
|
91
|
-
this.err.write(this.paint('highlight', '●') + ' ' + bold(title, this.
|
|
218
|
+
this.err.write(this.paint('highlight', '●') + ' ' + bold(title, this.effectiveLevel()) + ' ' + dim(message, this.effectiveLevel()) + '\n');
|
|
92
219
|
}
|
|
93
220
|
mark(kind) {
|
|
94
221
|
const glyph = kind === 'success' ? (this.unicode ? '✓' : 'v') : kind === 'error' ? (this.unicode ? '✗' : 'x') : this.unicode ? '⚠' : '!';
|
|
95
222
|
return this.paint(kind, glyph);
|
|
96
223
|
}
|
|
97
224
|
paint(key, text) {
|
|
98
|
-
return paint(this.theme.colors[key], text, this.
|
|
225
|
+
return paint(this.theme.colors[key], text, this.effectiveLevel());
|
|
99
226
|
}
|
|
100
227
|
/** Visible width of the current terminal column, for wrapping decisions. */
|
|
101
228
|
padTo(text, width) {
|
package/dist/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAC3D,OAAO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AAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mudah-cli/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Terminal design system: tokens, themes, output primitives, tables, panels, and markdown rendering.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mudah-cli/terminal": "^0.
|
|
21
|
+
"@mudah-cli/terminal": "^0.2.0"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|