codeam-cli 1.1.5 → 1.1.7

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 +12 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ var import_picocolors = __toESM(require("picocolors"));
110
110
  // package.json
111
111
  var package_default = {
112
112
  name: "codeam-cli",
113
- version: "1.1.5",
113
+ version: "1.1.7",
114
114
  description: "Remote control Claude Code from your mobile device",
115
115
  main: "dist/index.js",
116
116
  bin: {
@@ -842,25 +842,27 @@ function renderToLines(raw) {
842
842
  }
843
843
  function detectSelector(raw) {
844
844
  const stripped = raw.replace(/\x1B\[[^@-~]*[@-~]/g, "").replace(/\x1B\][^\x07\x1B]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[@-Z\\-_]/g, "");
845
- const hasNavHint = /Enter to (?:select|enter)/i.test(stripped) || /↑\s*\/\s*↓\s*to\s*navigate/i.test(stripped);
846
- if (!hasNavHint) return null;
847
845
  const segments = stripped.split(/[\r\n]+/);
848
846
  const optionMap = /* @__PURE__ */ new Map();
847
+ let hasHighlight = false;
849
848
  for (const seg of segments) {
850
849
  const t = seg.trim();
851
850
  if (!t) continue;
852
- const m = t.match(/^[❯>]?\s*(\d+)\.\s+(.+)/);
851
+ const m = t.match(/^(❯)?\s*(\d+)\.\s+(.+)/);
853
852
  if (m) {
854
- const num = parseInt(m[1], 10);
855
- if (!optionMap.has(num)) optionMap.set(num, m[2].trim());
853
+ if (m[1] === "\u276F") hasHighlight = true;
854
+ const num = parseInt(m[2], 10);
855
+ if (!optionMap.has(num)) optionMap.set(num, m[3].trim());
856
856
  }
857
857
  }
858
- const options = [...optionMap.entries()].sort(([a], [b]) => a - b).map(([, label]) => label);
859
- if (options.length === 0) return null;
858
+ if (!hasHighlight) return null;
859
+ const keys = [...optionMap.keys()].sort((a, b) => a - b);
860
+ if (keys.length < 2 || keys[0] !== 1) return null;
861
+ const options = keys.map((k) => optionMap.get(k));
860
862
  let question = "";
861
863
  for (let i = segments.length - 1; i >= 0; i--) {
862
864
  const t = segments[i].trim();
863
- if (t.endsWith("?") && !/Enter to select/i.test(t) && !/^[❯>]?\s*\d+\./.test(t)) {
865
+ if (t.endsWith("?") && !/^❯?\s*\d+\./.test(t)) {
864
866
  question = t;
865
867
  break;
866
868
  }
@@ -880,8 +882,7 @@ function filterChrome(lines) {
880
882
  if (/^\(thinking\)\s*$/.test(t)) return false;
881
883
  if (/^\?\s.*shortcut/i.test(t)) return false;
882
884
  if (/spending limit|usage limit/i.test(t) && t.length < 80) return false;
883
- if (/Enter to (?:select|enter)/i.test(t)) return false;
884
- if (/↑\s*\/\s*↓\s*to\s*navigate/i.test(t)) return false;
885
+ if (/↑\s*\/?\s*↓\s*to\s*navigate/i.test(t)) return false;
885
886
  return true;
886
887
  });
887
888
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Remote control Claude Code from your mobile device",
5
5
  "main": "dist/index.js",
6
6
  "bin": {