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