@nonbot/cli 0.5.13 → 0.5.14
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/CHANGELOG.md +9 -0
- package/dist/index.js +0 -0
- package/dist/lib/output.js +35 -45
- package/dist/lib/terminal.js +0 -6
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @nonbot/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.14
|
|
4
|
+
|
|
5
|
+
- Daemon startup banner: the non.bot wordmark now renders with a colour
|
|
6
|
+
gradient, and the connection-status block (CONNECTED + listening/poll lines)
|
|
7
|
+
sits directly below the logo instead of to its right — so it never clips or
|
|
8
|
+
wraps when a tmux pane is narrower than the logo.
|
|
9
|
+
- Dropped the Ghostty terminal profile (unused). A `ghostty` preference now
|
|
10
|
+
falls back to the platform default like any other unknown terminal.
|
|
11
|
+
|
|
3
12
|
## 0.5.10
|
|
4
13
|
|
|
5
14
|
- Build now strips source comments from the published output, so no internal
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/lib/output.js
CHANGED
|
@@ -137,6 +137,37 @@ const WORDMARK_LINES = [
|
|
|
137
137
|
];
|
|
138
138
|
export const WORDMARK_WIDTH = 63;
|
|
139
139
|
export const WORDMARK_HEIGHT = 6;
|
|
140
|
+
export const WORDMARK_GRADIENT = [
|
|
141
|
+
'#13b9e2', '#1abadc', '#20bad7', '#27bbd1', '#2ebbcb', '#35bcc5', '#3bbdc0',
|
|
142
|
+
'#42bdba', '#49beb4', '#50bfae', '#50bfae', '#5dc0a3', '#64c09d', '#6bc197',
|
|
143
|
+
'#71c292', '#78c28c', '#7fc386', '#86c380', '#8cc47b', '#93c575', '#93c575',
|
|
144
|
+
'#a1c669', '#a7c664', '#aec75e', '#b5c858', '#bcc852', '#c2c94d', '#c9ca47',
|
|
145
|
+
'#d0ca41', '#d7cb3b', '#ddcb36', '#e4cc30', '#e0c536', '#dcbf3b', '#d8b841',
|
|
146
|
+
'#d4b246', '#d0ab4c', '#cca551', '#c89e57', '#c4975d', '#c09162', '#bc8a68',
|
|
147
|
+
'#bc8a68', '#bc8a68', '#b07679', '#ac707e', '#a86984', '#a36389', '#9f5c8f',
|
|
148
|
+
'#9b5694', '#974f9a', '#9348a0', '#8f42a5', '#8f42a5', '#8735b0', '#832eb6',
|
|
149
|
+
'#7f27bc', '#7b21c1', '#771ac7', '#7314cc', '#6f0dd2', '#6b07d7', '#6700dd',
|
|
150
|
+
];
|
|
151
|
+
function hexFg(hex) {
|
|
152
|
+
const n = parseInt(hex.slice(1), 16);
|
|
153
|
+
return `\x1b[38;2;${(n >> 16) & 255};${(n >> 8) & 255};${n & 255}m`;
|
|
154
|
+
}
|
|
155
|
+
function paintWordmarkLine(line, stream = process.stdout) {
|
|
156
|
+
if (!isTTY(stream))
|
|
157
|
+
return line;
|
|
158
|
+
const chars = Array.from(line);
|
|
159
|
+
let out = '';
|
|
160
|
+
for (let i = 0; i < chars.length; i++) {
|
|
161
|
+
const ch = chars[i];
|
|
162
|
+
if (ch === ' ') {
|
|
163
|
+
out += ' ';
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const hex = WORDMARK_GRADIENT[i] ?? WORDMARK_GRADIENT[WORDMARK_GRADIENT.length - 1];
|
|
167
|
+
out += BRAND.bold + hexFg(hex) + ch + BRAND.reset;
|
|
168
|
+
}
|
|
169
|
+
return out;
|
|
170
|
+
}
|
|
140
171
|
export function terminalWidth(width) {
|
|
141
172
|
const cols = width ?? (process.stdout && process.stdout.columns) ?? 80;
|
|
142
173
|
const min = WORDMARK_WIDTH + 6;
|
|
@@ -153,7 +184,7 @@ function trackedCaps(s) {
|
|
|
153
184
|
export function wordmark(version, opts = {}) {
|
|
154
185
|
const stream = opts.stream ?? process.stdout;
|
|
155
186
|
const state = opts.state;
|
|
156
|
-
const headLines = WORDMARK_LINES.map((line) =>
|
|
187
|
+
const headLines = WORDMARK_LINES.map((line) => paintWordmarkLine(line, stream));
|
|
157
188
|
const parts = [c.cyan(trackedCaps('DAEMON'), stream)];
|
|
158
189
|
if (version) {
|
|
159
190
|
parts.push(c.muted('·', stream));
|
|
@@ -171,7 +202,6 @@ export function visibleLength(s) {
|
|
|
171
202
|
}
|
|
172
203
|
export function renderWordmarkWithBadge(opts = {}) {
|
|
173
204
|
const stream = opts.stream ?? process.stdout;
|
|
174
|
-
const cols = terminalWidth(opts.width);
|
|
175
205
|
const color = opts.badgeColor ?? 'green';
|
|
176
206
|
const label = opts.badgeLabel ?? 'CONNECTED';
|
|
177
207
|
const sublines = opts.badgeSublines ?? [];
|
|
@@ -181,50 +211,10 @@ export function renderWordmarkWithBadge(opts = {}) {
|
|
|
181
211
|
red: (s) => c.red(s, stream),
|
|
182
212
|
muted: (s) => c.muted(s, stream),
|
|
183
213
|
};
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const headRaw = `${dotColored[color]('●')} ${dotColored[color](label)}`;
|
|
188
|
-
const inlineSublines = [];
|
|
189
|
-
const overflowSublines = [];
|
|
214
|
+
const lines = WORDMARK_LINES.map((wm) => paintWordmarkLine(wm, stream));
|
|
215
|
+
lines.push('');
|
|
216
|
+
lines.push(` ${dotColored[color]('●')} ${dotColored[color](label)}`);
|
|
190
217
|
for (const s of sublines) {
|
|
191
|
-
if (s.length <= rightColWidth && inlineSublines.length < WORDMARK_HEIGHT - 1) {
|
|
192
|
-
inlineSublines.push(s);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
overflowSublines.push(s);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
const headFits = headVisible.length <= rightColWidth;
|
|
199
|
-
if (!headFits) {
|
|
200
|
-
overflowSublines.unshift(`${label}`);
|
|
201
|
-
}
|
|
202
|
-
const rightRowsVisible = [];
|
|
203
|
-
const rightRowsRaw = [];
|
|
204
|
-
if (headFits) {
|
|
205
|
-
rightRowsVisible.push(headVisible);
|
|
206
|
-
rightRowsRaw.push(headRaw);
|
|
207
|
-
}
|
|
208
|
-
for (const s of inlineSublines) {
|
|
209
|
-
rightRowsVisible.push(s);
|
|
210
|
-
rightRowsRaw.push(c.muted(s, stream));
|
|
211
|
-
}
|
|
212
|
-
const lines = [];
|
|
213
|
-
for (let r = 0; r < WORDMARK_LINES.length; r++) {
|
|
214
|
-
const wm = WORDMARK_LINES[r];
|
|
215
|
-
const wmPainted = c.bold(c.white(wm, stream), stream);
|
|
216
|
-
if (r >= rightRowsRaw.length) {
|
|
217
|
-
lines.push(wmPainted);
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
const rightRaw = rightRowsRaw[r];
|
|
221
|
-
const rightVisible = rightRowsVisible[r] ?? '';
|
|
222
|
-
const wmVisibleLen = wm.length;
|
|
223
|
-
const rightLen = rightVisible.length;
|
|
224
|
-
const gap = Math.max(minGap, cols - wmVisibleLen - rightLen);
|
|
225
|
-
lines.push(wmPainted + ' '.repeat(gap) + rightRaw);
|
|
226
|
-
}
|
|
227
|
-
for (const s of overflowSublines) {
|
|
228
218
|
lines.push(` ${c.muted(s, stream)}`);
|
|
229
219
|
}
|
|
230
220
|
return lines.join('\n');
|
package/dist/lib/terminal.js
CHANGED
|
@@ -101,12 +101,6 @@ export const TERMINAL_PROFILES = [
|
|
|
101
101
|
]));
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
|
-
{
|
|
105
|
-
id: 'ghostty',
|
|
106
|
-
displayName: 'Ghostty',
|
|
107
|
-
platform: 'darwin',
|
|
108
|
-
launch: (s) => ({ cmd: 'open', args: ['-na', 'Ghostty', '--args', '-e', 'bash', s] }),
|
|
109
|
-
},
|
|
110
104
|
{
|
|
111
105
|
id: 'wezterm',
|
|
112
106
|
displayName: 'WezTerm',
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.5.
|
|
1
|
+
export const VERSION = '0.5.14';
|
package/package.json
CHANGED