codeam-cli 1.1.6 → 1.1.8
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 +18 -18
- 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.
|
|
113
|
+
version: "1.1.8",
|
|
114
114
|
description: "Remote control Claude Code from your mobile device",
|
|
115
115
|
main: "dist/index.js",
|
|
116
116
|
bin: {
|
|
@@ -841,31 +841,31 @@ function renderToLines(raw) {
|
|
|
841
841
|
return screen;
|
|
842
842
|
}
|
|
843
843
|
function detectSelector(raw) {
|
|
844
|
-
if (!/\x1B\[\d*A/.test(raw)) return null;
|
|
845
844
|
const stripped = raw.replace(/\x1B\[[^@-~]*[@-~]/g, "").replace(/\x1B\][^\x07\x1B]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[@-Z\\-_]/g, "");
|
|
845
|
+
if (!stripped.includes("\u276F")) return null;
|
|
846
846
|
const segments = stripped.split(/[\r\n]+/);
|
|
847
847
|
const optionMap = /* @__PURE__ */ new Map();
|
|
848
|
+
let hasHighlight = false;
|
|
849
|
+
let question = "";
|
|
850
|
+
const optRe = /(?:(❯)\s*)?(\d+)\.\s+((?:(?!\s*\d+\.\s).)+)/g;
|
|
848
851
|
for (const seg of segments) {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
if (!optionMap.has(num)) optionMap.set(num,
|
|
852
|
+
if (!seg.trim()) continue;
|
|
853
|
+
for (const m of seg.matchAll(optRe)) {
|
|
854
|
+
if (m[1] === "\u276F") hasHighlight = true;
|
|
855
|
+
const num = parseInt(m[2], 10);
|
|
856
|
+
const label = m[3].replace(/\s+/g, " ").trim();
|
|
857
|
+
if (label && !optionMap.has(num)) optionMap.set(num, label);
|
|
858
|
+
}
|
|
859
|
+
const beforeOptions = seg.replace(/(?:❯\s*)?\d+\.\s+.*/g, "").trim();
|
|
860
|
+
if (beforeOptions.endsWith("?")) {
|
|
861
|
+
const q = beforeOptions.match(/([^?]+\?)$/);
|
|
862
|
+
if (q) question = q[1].trim();
|
|
855
863
|
}
|
|
856
864
|
}
|
|
865
|
+
if (!hasHighlight) return null;
|
|
857
866
|
const keys = [...optionMap.keys()].sort((a, b) => a - b);
|
|
858
867
|
if (keys.length < 2 || keys[0] !== 1) return null;
|
|
859
|
-
|
|
860
|
-
let question = "";
|
|
861
|
-
for (let i = segments.length - 1; i >= 0; i--) {
|
|
862
|
-
const t = segments[i].trim();
|
|
863
|
-
if (t.endsWith("?") && !/^[❯>]?\s*\d+\./.test(t)) {
|
|
864
|
-
question = t;
|
|
865
|
-
break;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
return { question, options };
|
|
868
|
+
return { question, options: keys.map((k) => optionMap.get(k)) };
|
|
869
869
|
}
|
|
870
870
|
function filterChrome(lines) {
|
|
871
871
|
return lines.filter((line) => {
|