nolo-cli 0.5.2 → 0.6.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/index.js +49 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -108103,24 +108103,54 @@ function renderStatusLine(state4) {
|
|
|
108103
108103
|
if (!surface) return body;
|
|
108104
108104
|
return `${surface} ${body} \x1B[49m`;
|
|
108105
108105
|
}
|
|
108106
|
+
function buildPlainScene(isDark) {
|
|
108107
|
+
const sky = isDark ? "\u263E" : "\u2600";
|
|
108108
|
+
return [
|
|
108109
|
+
` ${sky}`,
|
|
108110
|
+
isDark ? " \u2571\u2572 \xB7" : " \u2571\u2572",
|
|
108111
|
+
" \u2571 \u2572",
|
|
108112
|
+
isDark ? " \u2571 \u2572 \u2726" : " \u2571 \u2572",
|
|
108113
|
+
" \u2571 \u2660 \u2660 \u2572",
|
|
108114
|
+
" \u2581\u2581\u2581\u2581\u2581\u2581\u2571 \u2660\u2660 \u2572\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581",
|
|
108115
|
+
" \u2588\u2584 \u2588 \u2584\u2580\u2580\u2584 \u2588 \u2584\u2580\u2580\u2584",
|
|
108116
|
+
" \u2588 \u2580\u2588 \u2588 \u2588 \u2588 \u2588 \u2588",
|
|
108117
|
+
" \u2580 \u2580 \u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580",
|
|
108118
|
+
" \u2570\u256E~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~\u2570\u256E\u2248~"
|
|
108119
|
+
].join("\n");
|
|
108120
|
+
}
|
|
108121
|
+
function buildColoredScene(isDark) {
|
|
108122
|
+
const pk = themeColorSequence("chrome");
|
|
108123
|
+
const sk = themeColorSequence("warning");
|
|
108124
|
+
const st = themeColorSequence("muted");
|
|
108125
|
+
const tr = themeColorSequence("success");
|
|
108126
|
+
const wv = themeColorSequence("info");
|
|
108127
|
+
const ac = themeColorSequence("accent");
|
|
108128
|
+
const cr = themeColorSequence("chrome");
|
|
108129
|
+
const r = "\x1B[39m";
|
|
108130
|
+
const b = "\x1B[1m";
|
|
108131
|
+
const rs = "\x1B[0m";
|
|
108132
|
+
const sky = isDark ? "\u263E" : "\u2600";
|
|
108133
|
+
return [
|
|
108134
|
+
` ${sk}${sky}${r}`,
|
|
108135
|
+
isDark ? ` ${pk}\u2571\u2572${r} ${st}\xB7${r}` : ` ${pk}\u2571\u2572${r}`,
|
|
108136
|
+
` ${pk}\u2571 \u2572${r}`,
|
|
108137
|
+
isDark ? ` ${pk}\u2571 \u2572${r} ${st}\u2726${r}` : ` ${pk}\u2571 \u2572${r}`,
|
|
108138
|
+
` ${pk}\u2571${r} ${tr}\u2660 \u2660${r} ${pk}\u2572${r}`,
|
|
108139
|
+
` ${pk}\u2581\u2581\u2581\u2581\u2581\u2581\u2571${r} ${tr}\u2660\u2660${r} ${pk}\u2572\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581${r}`,
|
|
108140
|
+
` ${b}${ac}\u2588\u2584 \u2588 \u2584\u2580\u2580\u2584 \u2588 \u2584\u2580\u2580\u2584${rs}`,
|
|
108141
|
+
` ${ac}\u2588 \u2580\u2588 \u2588 \u2588 \u2588 \u2588 \u2588${r}`,
|
|
108142
|
+
` ${cr}\u2580 \u2580 \u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580${r}`,
|
|
108143
|
+
` ${wv}\u2570\u256E~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~~\u2248~\u2570\u256E\u2248~${r}`
|
|
108144
|
+
].join("\n");
|
|
108145
|
+
}
|
|
108106
108146
|
function renderWelcome(state4) {
|
|
108107
108147
|
const colorEnabled = resolveCliColorEnabled();
|
|
108108
|
-
const
|
|
108109
|
-
|
|
108110
|
-
|
|
108111
|
-
{ mark: "\u2580 \u2580 \u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580", ridge: "\u2571 \u2572\u2582\u2581\u2581\u2660 \u2570\u256E~", token: "chrome", bold: false }
|
|
108112
|
-
];
|
|
108113
|
-
const MARK_WIDTH = 19;
|
|
108114
|
-
const GUTTER = " ";
|
|
108115
|
-
const logoArt = logoRows.map(({ mark, ridge, token, bold }) => {
|
|
108116
|
-
const padded = mark.padEnd(MARK_WIDTH);
|
|
108117
|
-
if (!colorEnabled) return `${padded}${GUTTER}${ridge}`;
|
|
108118
|
-
const markText = bold ? `\x1B[1m${themeColorSequence(token)}${padded}\x1B[0m` : themeText(padded, token, colorEnabled);
|
|
108119
|
-
return `${markText}${GUTTER}${themeText(ridge, "chrome", colorEnabled)}`;
|
|
108120
|
-
}).join("\n");
|
|
108148
|
+
const brightness = resolveTuiBrightness();
|
|
108149
|
+
const isDark = brightness === "dark";
|
|
108150
|
+
const sceneArt = colorEnabled ? buildColoredScene(isDark) : buildPlainScene(isDark);
|
|
108121
108151
|
const versionLine = colorEnabled ? `\x1B[1m${themeColorSequence("accent")}nolo\x1B[0m ${state4.cliVersion ?? ""} | server ${state4.serverUrl}`.replace(" |", " |") : `nolo ${state4.cliVersion ?? ""} | server ${state4.serverUrl}`.replace(" |", " |");
|
|
108122
108152
|
return [
|
|
108123
|
-
|
|
108153
|
+
sceneArt,
|
|
108124
108154
|
versionLine,
|
|
108125
108155
|
t("welcomeHint"),
|
|
108126
108156
|
""
|
|
@@ -109950,8 +109980,9 @@ function createFixedInput(output2, config) {
|
|
|
109950
109980
|
for (const line of queueLines) {
|
|
109951
109981
|
sections.push(fitAnsiLine(line.replace(/\r?\n/g, " "), cols));
|
|
109952
109982
|
}
|
|
109953
|
-
const
|
|
109954
|
-
const promptWidth = displayWidth2(
|
|
109983
|
+
const promptRaw = t("promptLabel");
|
|
109984
|
+
const promptWidth = displayWidth2(promptRaw);
|
|
109985
|
+
const prompt = colorEnabled ? `${themeColorSequence("accent")}${promptRaw}\x1B[39m` : promptRaw;
|
|
109955
109986
|
const contentWidth = Math.max(1, cols - promptWidth);
|
|
109956
109987
|
const logicalLines = buffer.length === 0 ? [""] : buffer.split("\n");
|
|
109957
109988
|
const targetPos = Math.max(0, Math.min(buffer.length, cursorPos ?? buffer.length));
|
|
@@ -109965,7 +109996,7 @@ function createFixedInput(output2, config) {
|
|
|
109965
109996
|
const isFirst = i === 0;
|
|
109966
109997
|
const prefix = isFirst ? prompt : " ".repeat(promptWidth);
|
|
109967
109998
|
if (buffer.length === 0) {
|
|
109968
|
-
const placeholder =
|
|
109999
|
+
const placeholder = themeText(t("placeholder"), "chrome", colorEnabled);
|
|
109969
110000
|
sections.push(fitAnsiLine(`${prefix}${placeholder}`, cols));
|
|
109970
110001
|
cursorCol = promptWidth;
|
|
109971
110002
|
cursorRow = 0;
|
|
@@ -109984,7 +110015,7 @@ function createFixedInput(output2, config) {
|
|
|
109984
110015
|
if (targetPos <= charOffset + rowLen || j === rows.length - 1 && i === logicalLines.length - 1) {
|
|
109985
110016
|
const subOffset = Math.max(0, Math.min(rowLen, targetPos - charOffset));
|
|
109986
110017
|
const subStr = rowText.slice(0, subOffset);
|
|
109987
|
-
cursorCol =
|
|
110018
|
+
cursorCol = promptWidth + displayWidth2(subStr);
|
|
109988
110019
|
cursorRow = inputRows;
|
|
109989
110020
|
cursorFound = true;
|
|
109990
110021
|
}
|