@rotorsoft/gent 1.25.3 → 1.26.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.js +54 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2247,7 +2247,7 @@ import { homedir } from "os";
|
|
|
2247
2247
|
// package.json
|
|
2248
2248
|
var package_default = {
|
|
2249
2249
|
name: "@rotorsoft/gent",
|
|
2250
|
-
version: "1.
|
|
2250
|
+
version: "1.26.0",
|
|
2251
2251
|
description: "AI-powered GitHub workflow CLI - leverage AI (Claude, Gemini, or Codex) to create tickets, implement features, and manage PRs",
|
|
2252
2252
|
keywords: [
|
|
2253
2253
|
"cli",
|
|
@@ -3187,46 +3187,65 @@ function readKey() {
|
|
|
3187
3187
|
stdin.setRawMode(true);
|
|
3188
3188
|
stdin.resume();
|
|
3189
3189
|
stdin.setEncoding("utf8");
|
|
3190
|
+
process.stdout.write("\x1B[?2004h");
|
|
3191
|
+
const done = (key) => {
|
|
3192
|
+
process.stdout.write("\x1B[?2004l");
|
|
3193
|
+
resolve(key);
|
|
3194
|
+
};
|
|
3190
3195
|
const onData = (data) => {
|
|
3191
3196
|
stdin.setRawMode(wasRaw ?? false);
|
|
3192
3197
|
stdin.pause();
|
|
3193
3198
|
stdin.removeListener("data", onData);
|
|
3194
|
-
if (data
|
|
3195
|
-
|
|
3199
|
+
if (data.startsWith("\x1B[200~")) {
|
|
3200
|
+
const endMarker = "\x1B[201~";
|
|
3201
|
+
const endIdx = data.indexOf(endMarker);
|
|
3202
|
+
const content = (endIdx >= 0 ? data.slice(6, endIdx) : data.slice(6)).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
3203
|
+
done({ name: "paste", raw: content });
|
|
3204
|
+
} else if (data === "") {
|
|
3205
|
+
done({ name: "escape", raw: data });
|
|
3196
3206
|
} else if (data === "\x1B" || data === "\x1B\x1B") {
|
|
3197
|
-
|
|
3207
|
+
done({ name: "escape", raw: data });
|
|
3198
3208
|
} else if (data === "\x1B[A") {
|
|
3199
|
-
|
|
3209
|
+
done({ name: "up", raw: data });
|
|
3200
3210
|
} else if (data === "\x1B[B") {
|
|
3201
|
-
|
|
3211
|
+
done({ name: "down", raw: data });
|
|
3202
3212
|
} else if (data === "\x1B[C") {
|
|
3203
|
-
|
|
3213
|
+
done({ name: "right", raw: data });
|
|
3204
3214
|
} else if (data === "\x1B[D") {
|
|
3205
|
-
|
|
3215
|
+
done({ name: "left", raw: data });
|
|
3206
3216
|
} else if (data === "\x1B[1;5C" || data === "\x1B[5C") {
|
|
3207
|
-
|
|
3217
|
+
done({ name: "ctrl-right", raw: data });
|
|
3208
3218
|
} else if (data === "\x1B[1;5D" || data === "\x1B[5D") {
|
|
3209
|
-
|
|
3219
|
+
done({ name: "ctrl-left", raw: data });
|
|
3210
3220
|
} else if (data === "\x1B[3~") {
|
|
3211
|
-
|
|
3221
|
+
done({ name: "delete", raw: data });
|
|
3212
3222
|
} else if (data === "\x1B[H" || data === "\x1B[1~") {
|
|
3213
|
-
|
|
3223
|
+
done({ name: "home", raw: data });
|
|
3214
3224
|
} else if (data === "\x1B[F" || data === "\x1B[4~") {
|
|
3215
|
-
|
|
3225
|
+
done({ name: "end", raw: data });
|
|
3216
3226
|
} else if (data === "") {
|
|
3217
|
-
|
|
3227
|
+
done({ name: "home", raw: data });
|
|
3218
3228
|
} else if (data === "") {
|
|
3219
|
-
|
|
3229
|
+
done({ name: "end", raw: data });
|
|
3220
3230
|
} else if (data === "\r" || data === "\n") {
|
|
3221
|
-
|
|
3231
|
+
done({ name: "enter", raw: data });
|
|
3222
3232
|
} else if (data === "\x7F" || data === "\b") {
|
|
3223
|
-
|
|
3233
|
+
done({ name: "backspace", raw: data });
|
|
3224
3234
|
} else if (data === " ") {
|
|
3225
|
-
|
|
3235
|
+
done({ name: "tab", raw: data });
|
|
3226
3236
|
} else if (data === "") {
|
|
3227
|
-
|
|
3237
|
+
done({ name: "ctrl-s", raw: data });
|
|
3228
3238
|
} else if (data.length === 1 && data.charCodeAt(0) >= 32) {
|
|
3229
|
-
|
|
3239
|
+
done({ name: data, raw: data });
|
|
3240
|
+
} else if (data.length > 1 && !data.startsWith("\x1B")) {
|
|
3241
|
+
const filtered = [...data.replace(/\r\n/g, "\n").replace(/\r/g, "\n")].filter((c) => c.charCodeAt(0) >= 32 || c === "\n").join("");
|
|
3242
|
+
if (filtered.length > 0) {
|
|
3243
|
+
done({ name: "paste", raw: filtered });
|
|
3244
|
+
} else {
|
|
3245
|
+
stdin.setRawMode(true);
|
|
3246
|
+
stdin.resume();
|
|
3247
|
+
stdin.on("data", onData);
|
|
3248
|
+
}
|
|
3230
3249
|
} else {
|
|
3231
3250
|
stdin.setRawMode(true);
|
|
3232
3251
|
stdin.resume();
|
|
@@ -3381,6 +3400,15 @@ async function showInput(opts) {
|
|
|
3381
3400
|
}
|
|
3382
3401
|
render();
|
|
3383
3402
|
break;
|
|
3403
|
+
case "paste": {
|
|
3404
|
+
const flat = key.raw.replace(/\n/g, "");
|
|
3405
|
+
if (flat.length > 0) {
|
|
3406
|
+
value += flat;
|
|
3407
|
+
cursorBlink = true;
|
|
3408
|
+
render();
|
|
3409
|
+
}
|
|
3410
|
+
break;
|
|
3411
|
+
}
|
|
3384
3412
|
default:
|
|
3385
3413
|
if (key.raw.length === 1 && key.raw.charCodeAt(0) >= 32) {
|
|
3386
3414
|
value += key.raw;
|
|
@@ -3575,6 +3603,12 @@ async function showMultilineInput(opts) {
|
|
|
3575
3603
|
cursorPos = moveCursorWordRight(value, cursorPos);
|
|
3576
3604
|
render();
|
|
3577
3605
|
break;
|
|
3606
|
+
case "paste":
|
|
3607
|
+
value = value.slice(0, cursorPos) + key.raw + value.slice(cursorPos);
|
|
3608
|
+
cursorPos += key.raw.length;
|
|
3609
|
+
cursorBlink = true;
|
|
3610
|
+
render();
|
|
3611
|
+
break;
|
|
3578
3612
|
default:
|
|
3579
3613
|
if (key.raw.length === 1 && key.raw.charCodeAt(0) >= 32) {
|
|
3580
3614
|
value = value.slice(0, cursorPos) + key.raw + value.slice(cursorPos);
|