nomadexapp 0.2.13 → 0.2.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/bin/nomadex.mjs +58 -12
- package/package.json +1 -1
package/bin/nomadex.mjs
CHANGED
|
@@ -95,20 +95,59 @@ const centerText = (text, width) => {
|
|
|
95
95
|
return `${" ".repeat(leftPadding)}${text}${" ".repeat(rightPadding)}`;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
+
const wrapText = (text, width) => {
|
|
99
|
+
const words = text.trim().split(/\s+/u).filter(Boolean);
|
|
100
|
+
if (words.length === 0) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const lines = [];
|
|
105
|
+
let current = words[0];
|
|
106
|
+
|
|
107
|
+
for (let index = 1; index < words.length; index += 1) {
|
|
108
|
+
const nextWord = words[index];
|
|
109
|
+
if (`${current} ${nextWord}`.length <= width) {
|
|
110
|
+
current = `${current} ${nextWord}`;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
lines.push(current);
|
|
115
|
+
current = nextWord;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
lines.push(current);
|
|
119
|
+
return lines;
|
|
120
|
+
};
|
|
121
|
+
|
|
98
122
|
const printStartupBanner = () => {
|
|
99
|
-
const
|
|
123
|
+
const terminalWidth =
|
|
124
|
+
typeof process.stdout.columns === "number" && process.stdout.columns > 0
|
|
125
|
+
? process.stdout.columns
|
|
126
|
+
: 80;
|
|
127
|
+
const innerWidth = Math.max(28, Math.min(66, terminalWidth - 4));
|
|
100
128
|
const accentStart = [94, 235, 255];
|
|
101
129
|
const accentEnd = [220, 128, 255];
|
|
102
130
|
const borderColor = [82, 105, 138];
|
|
103
|
-
const
|
|
131
|
+
const wideBannerLines = [
|
|
104
132
|
{ color: [94, 235, 255], text: " _ _ ___ __ __ _ ____ _____ __ __" },
|
|
105
133
|
{ color: [106, 218, 255], text: "| \\ | | / _ \\ | \\/ | / \\ | _ \\ | ____| \\ \\/ /" },
|
|
106
134
|
{ color: [131, 194, 255], text: "| \\| || | | || |\\/| | / _ \\ | | | || _| \\ / " },
|
|
107
135
|
{ color: [170, 160, 255], text: "| |\\ || |_| || | | |/ ___ \\| |_| || |___ / \\ " },
|
|
108
136
|
{ color: [220, 128, 255], text: "|_| \\_| \\___/ |_| |_/_/ \\_\\____/ |_____| /_/\\_\\" },
|
|
109
137
|
];
|
|
138
|
+
const compactBannerLines = [
|
|
139
|
+
{ color: [94, 235, 255], text: " _ _ ___ __ __ _ ___ _____ " },
|
|
140
|
+
{ color: [120, 205, 255], text: "| \\| |/ _ \\| \\/ | /_\\ | \\| __|" },
|
|
141
|
+
{ color: [166, 164, 255], text: "| .` | (_) | |\\/| |/ _ \\| |) | _| " },
|
|
142
|
+
{ color: [220, 128, 255], text: "|_|\\_|\\___/|_| |_/_/ \\_\\___/|___|" },
|
|
143
|
+
];
|
|
110
144
|
const metaLine = "remote workspace for local coding agents";
|
|
111
145
|
const providerLine = "codex opencode qwen code claude code antigravity";
|
|
146
|
+
const bannerLines = wideBannerLines.every((line) => line.text.length <= innerWidth)
|
|
147
|
+
? wideBannerLines
|
|
148
|
+
: compactBannerLines.every((line) => line.text.length <= innerWidth)
|
|
149
|
+
? compactBannerLines
|
|
150
|
+
: [];
|
|
112
151
|
const topBorder = gradientText(
|
|
113
152
|
`+${"-".repeat(innerWidth + 2)}+`,
|
|
114
153
|
accentStart,
|
|
@@ -142,17 +181,24 @@ const printStartupBanner = () => {
|
|
|
142
181
|
)}\n`,
|
|
143
182
|
);
|
|
144
183
|
}
|
|
184
|
+
if (bannerLines.length > 0) {
|
|
185
|
+
process.stdout.write(`${frameLine(" ")}\n`);
|
|
186
|
+
}
|
|
187
|
+
for (const line of wrapText(metaLine, innerWidth)) {
|
|
188
|
+
process.stdout.write(
|
|
189
|
+
`${frameLine(centerText(line, innerWidth), (value) =>
|
|
190
|
+
paint(value, ansi.dim, colorRgb(149, 168, 194)),
|
|
191
|
+
)}\n`,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
145
194
|
process.stdout.write(`${frameLine(" ")}\n`);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
paint(value, ansi.dim, colorRgb(103, 215, 208)),
|
|
154
|
-
)}\n`,
|
|
155
|
-
);
|
|
195
|
+
for (const line of wrapText(providerLine, innerWidth)) {
|
|
196
|
+
process.stdout.write(
|
|
197
|
+
`${frameLine(centerText(line, innerWidth), (value) =>
|
|
198
|
+
paint(value, ansi.dim, colorRgb(103, 215, 208)),
|
|
199
|
+
)}\n`,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
156
202
|
process.stdout.write(`${bottomBorder}\n\n`);
|
|
157
203
|
};
|
|
158
204
|
|