lunel-cli 0.1.104 → 0.1.106
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/ai/codex.js +4 -0
- package/dist/index.js +36 -0
- package/package.json +1 -1
package/dist/ai/codex.js
CHANGED
|
@@ -37,9 +37,13 @@ export class CodexProvider {
|
|
|
37
37
|
async init() {
|
|
38
38
|
if (DEBUG_MODE)
|
|
39
39
|
console.log("Starting Codex app-server...");
|
|
40
|
+
const windowsSpawnOptions = process.platform === "win32"
|
|
41
|
+
? { shell: true }
|
|
42
|
+
: {};
|
|
40
43
|
this.proc = spawn("codex", ["app-server"], {
|
|
41
44
|
stdio: ["pipe", "pipe", "inherit"],
|
|
42
45
|
env: process.env,
|
|
46
|
+
...windowsSpawnOptions,
|
|
43
47
|
});
|
|
44
48
|
const rl = createInterface({ input: this.proc.stdout });
|
|
45
49
|
rl.on("line", (line) => this.handleLine(line));
|
package/dist/index.js
CHANGED
|
@@ -2932,6 +2932,41 @@ function displayQR(code) {
|
|
|
2932
2932
|
console.log(" Press Ctrl+C to exit.\n");
|
|
2933
2933
|
});
|
|
2934
2934
|
}
|
|
2935
|
+
function supportsAnsiStyles() {
|
|
2936
|
+
if (!process.stdout.isTTY)
|
|
2937
|
+
return false;
|
|
2938
|
+
if (process.env.NO_COLOR)
|
|
2939
|
+
return false;
|
|
2940
|
+
if (process.env.FORCE_COLOR)
|
|
2941
|
+
return true;
|
|
2942
|
+
if (process.platform !== "win32")
|
|
2943
|
+
return true;
|
|
2944
|
+
return Boolean(process.env.WT_SESSION ||
|
|
2945
|
+
process.env.ANSICON ||
|
|
2946
|
+
process.env.ConEmuANSI === "ON" ||
|
|
2947
|
+
process.env.TERM_PROGRAM ||
|
|
2948
|
+
process.env.TERM === "xterm-256color");
|
|
2949
|
+
}
|
|
2950
|
+
function displaySavedSessionNotice() {
|
|
2951
|
+
const useAnsiStyles = supportsAnsiStyles();
|
|
2952
|
+
const red = useAnsiStyles ? "\x1b[31m" : "";
|
|
2953
|
+
const bold = useAnsiStyles ? "\x1b[1m" : "";
|
|
2954
|
+
const reset = useAnsiStyles ? "\x1b[0m" : "";
|
|
2955
|
+
const lines = [
|
|
2956
|
+
"NOTE: You're using an existing session.",
|
|
2957
|
+
"You can open it from the app via Past Sessions and select this session.",
|
|
2958
|
+
"If you want a new QR code for pairing, run: npx lunel-cli -n",
|
|
2959
|
+
];
|
|
2960
|
+
const width = Math.max(...lines.map((line) => line.length));
|
|
2961
|
+
const border = `+${"-".repeat(width + 2)}+`;
|
|
2962
|
+
console.log("");
|
|
2963
|
+
console.log(`${red}${border}${reset}`);
|
|
2964
|
+
for (const line of lines) {
|
|
2965
|
+
console.log(`${red}|${reset} ${bold}${line.padEnd(width, " ")}${reset} ${red}|${reset}`);
|
|
2966
|
+
}
|
|
2967
|
+
console.log(`${red}${border}${reset}`);
|
|
2968
|
+
console.log("");
|
|
2969
|
+
}
|
|
2935
2970
|
function gracefulShutdown() {
|
|
2936
2971
|
shuttingDown = true;
|
|
2937
2972
|
console.log("\nShutting down...");
|
|
@@ -3119,6 +3154,7 @@ async function main() {
|
|
|
3119
3154
|
let sessionPasswordToUse;
|
|
3120
3155
|
if (!FORCE_NEW_CODE && savedSession) {
|
|
3121
3156
|
console.log(`Using saved session for ${ROOT_DIR}`);
|
|
3157
|
+
displaySavedSessionNotice();
|
|
3122
3158
|
sessionCodeToUse = savedSession.sessionCode;
|
|
3123
3159
|
sessionPasswordToUse = savedSession.sessionPassword;
|
|
3124
3160
|
usedSavedSession = true;
|