codeam-cli 1.3.9 → 1.4.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 +12 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -114,7 +114,7 @@ var import_picocolors = __toESM(require("picocolors"));
|
|
|
114
114
|
// package.json
|
|
115
115
|
var package_default = {
|
|
116
116
|
name: "codeam-cli",
|
|
117
|
-
version: "1.
|
|
117
|
+
version: "1.4.0",
|
|
118
118
|
description: "Remote control Claude Code from your mobile device",
|
|
119
119
|
main: "dist/index.js",
|
|
120
120
|
bin: {
|
|
@@ -962,10 +962,14 @@ function renderToLines(raw) {
|
|
|
962
962
|
}
|
|
963
963
|
function detectSelector(lines) {
|
|
964
964
|
if (lines.some((l) => /\?\s+for\s+shortcuts/i.test(l.trim()))) return null;
|
|
965
|
-
|
|
965
|
+
const clean = lines.map(
|
|
966
|
+
(l) => l.replace(/^[│╭╰╮╯┌└┐┘├┤┬┴┼]\s?/, "").replace(/\s*[│╭╰╮╯┌└┐┘├┤┬┴┼─━═]+\s*$/, "")
|
|
967
|
+
// strip trailing fill + border
|
|
968
|
+
);
|
|
969
|
+
if (!clean.some((l) => /^❯\s*\d+\./.test(l.trim()))) return null;
|
|
966
970
|
let optionStartIdx = -1;
|
|
967
|
-
for (let i = 0; i <
|
|
968
|
-
if (/^(?:❯\s*)?\d+\.\s/.test(
|
|
971
|
+
for (let i = 0; i < clean.length; i++) {
|
|
972
|
+
if (/^(?:❯\s*)?\d+\.\s/.test(clean[i].trim())) {
|
|
969
973
|
optionStartIdx = i;
|
|
970
974
|
break;
|
|
971
975
|
}
|
|
@@ -973,7 +977,7 @@ function detectSelector(lines) {
|
|
|
973
977
|
if (optionStartIdx === -1) return null;
|
|
974
978
|
const questionParts = [];
|
|
975
979
|
for (let i = 0; i < optionStartIdx; i++) {
|
|
976
|
-
const t =
|
|
980
|
+
const t = clean[i].trim();
|
|
977
981
|
if (!t) continue;
|
|
978
982
|
if (/^[─━—═\-]{3,}$/.test(t)) continue;
|
|
979
983
|
if (/^\[.*\]$/.test(t)) continue;
|
|
@@ -984,8 +988,8 @@ function detectSelector(lines) {
|
|
|
984
988
|
const optionLabels = /* @__PURE__ */ new Map();
|
|
985
989
|
const optionDescs = /* @__PURE__ */ new Map();
|
|
986
990
|
let currentNum = -1;
|
|
987
|
-
for (let i = optionStartIdx; i <
|
|
988
|
-
const t =
|
|
991
|
+
for (let i = optionStartIdx; i < clean.length; i++) {
|
|
992
|
+
const t = clean[i].trim();
|
|
989
993
|
if (!t) continue;
|
|
990
994
|
const m = t.match(/^(?:❯\s*)?(\d+)\.\s+(.+)/);
|
|
991
995
|
if (m) {
|
|
@@ -995,7 +999,7 @@ function detectSelector(lines) {
|
|
|
995
999
|
optionDescs.set(num, []);
|
|
996
1000
|
}
|
|
997
1001
|
currentNum = num;
|
|
998
|
-
} else if (currentNum !== -1 && !/^Enter to/i.test(t) && !/^[─━—═\-]{3,}$/.test(t) && !/↑.*↓.*navigate/i.test(t) && !/Esc to
|
|
1002
|
+
} else if (currentNum !== -1 && !/^Enter to/i.test(t) && !/^[─━—═\-]{3,}$/.test(t) && !/↑.*↓.*navigate/i.test(t) && !/Esc to/i.test(t)) {
|
|
999
1003
|
optionDescs.get(currentNum)?.push(t);
|
|
1000
1004
|
}
|
|
1001
1005
|
}
|