codeam-cli 1.3.9 → 1.4.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.
Files changed (2) hide show
  1. package/dist/index.js +16 -10
  2. 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.3.9",
117
+ version: "1.4.1",
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
- if (!lines.some((l) => /^❯\s*\d+\./.test(l.trim()))) return null;
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 < lines.length; i++) {
968
- if (/^(?:❯\s*)?\d+\.\s/.test(lines[i].trim())) {
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,19 +977,20 @@ 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 = lines[i].trim();
980
+ const t = clean[i].trim();
977
981
  if (!t) continue;
978
982
  if (/^[─━—═\-]{3,}$/.test(t)) continue;
979
983
  if (/^\[.*\]$/.test(t)) continue;
980
984
  if (/^[>❯]\s/.test(t)) continue;
985
+ if (!t.includes(" ") && t.length > 15) continue;
981
986
  questionParts.push(t);
982
987
  }
983
- const question = questionParts.join(" ").trim();
988
+ const question = questionParts.filter((line, i, arr) => !arr.some((other, j) => j !== i && other.includes(line))).join("\n").trim();
984
989
  const optionLabels = /* @__PURE__ */ new Map();
985
990
  const optionDescs = /* @__PURE__ */ new Map();
986
991
  let currentNum = -1;
987
- for (let i = optionStartIdx; i < lines.length; i++) {
988
- const t = lines[i].trim();
992
+ for (let i = optionStartIdx; i < clean.length; i++) {
993
+ const t = clean[i].trim();
989
994
  if (!t) continue;
990
995
  const m = t.match(/^(?:❯\s*)?(\d+)\.\s+(.+)/);
991
996
  if (m) {
@@ -995,7 +1000,7 @@ function detectSelector(lines) {
995
1000
  optionDescs.set(num, []);
996
1001
  }
997
1002
  currentNum = num;
998
- } else if (currentNum !== -1 && !/^Enter to/i.test(t) && !/^[─━—═\-]{3,}$/.test(t) && !/↑.*↓.*navigate/i.test(t) && !/Esc to cancel/i.test(t)) {
1003
+ } else if (currentNum !== -1 && !/^Enter to/i.test(t) && !/^[─━—═\-]{3,}$/.test(t) && !/↑.*↓.*navigate/i.test(t) && !/Esc to/i.test(t)) {
999
1004
  optionDescs.get(currentNum)?.push(t);
1000
1005
  }
1001
1006
  }
@@ -1035,9 +1040,10 @@ function detectListSelector(lines) {
1035
1040
  }
1036
1041
  if (/^[>❯]\s/.test(t)) continue;
1037
1042
  if (/[↑↓].*navigate/i.test(t)) continue;
1043
+ if (!t.includes(" ") && t.length > 15) continue;
1038
1044
  questionParts.push(t);
1039
1045
  }
1040
- const question = questionParts.join(" ").trim();
1046
+ const question = questionParts.filter((line, i, arr) => !arr.some((other, j) => j !== i && other.includes(line))).join("\n").trim();
1041
1047
  const options = [];
1042
1048
  let currentIndex = 0;
1043
1049
  for (const line of lines.slice(optionStartIdx)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "1.3.9",
3
+ "version": "1.4.1",
4
4
  "description": "Remote control Claude Code from your mobile device",
5
5
  "main": "dist/index.js",
6
6
  "bin": {