codeam-cli 1.1.8 → 1.2.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 +14 -21
- 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.
|
|
113
|
+
version: "1.2.0",
|
|
114
114
|
description: "Remote control Claude Code from your mobile device",
|
|
115
115
|
main: "dist/index.js",
|
|
116
116
|
bin: {
|
|
@@ -840,29 +840,22 @@ function renderToLines(raw) {
|
|
|
840
840
|
}
|
|
841
841
|
return screen;
|
|
842
842
|
}
|
|
843
|
-
function detectSelector(
|
|
844
|
-
|
|
845
|
-
if (!stripped.includes("\u276F")) return null;
|
|
846
|
-
const segments = stripped.split(/[\r\n]+/);
|
|
843
|
+
function detectSelector(lines) {
|
|
844
|
+
if (!lines.some((l) => l.includes("\u276F"))) return null;
|
|
847
845
|
const optionMap = /* @__PURE__ */ new Map();
|
|
848
|
-
let hasHighlight = false;
|
|
849
846
|
let question = "";
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
if (!
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
const num = parseInt(m[
|
|
856
|
-
const label = m[
|
|
847
|
+
for (const line of lines) {
|
|
848
|
+
const t = line.trim();
|
|
849
|
+
if (!t) continue;
|
|
850
|
+
const m = t.match(/^(?:❯\s*)?(\d+)\.\s+(.+)/);
|
|
851
|
+
if (m) {
|
|
852
|
+
const num = parseInt(m[1], 10);
|
|
853
|
+
const label = m[2].trim();
|
|
857
854
|
if (label && !optionMap.has(num)) optionMap.set(num, label);
|
|
855
|
+
continue;
|
|
858
856
|
}
|
|
859
|
-
|
|
860
|
-
if (beforeOptions.endsWith("?")) {
|
|
861
|
-
const q = beforeOptions.match(/([^?]+\?)$/);
|
|
862
|
-
if (q) question = q[1].trim();
|
|
863
|
-
}
|
|
857
|
+
if (t.endsWith("?")) question = t;
|
|
864
858
|
}
|
|
865
|
-
if (!hasHighlight) return null;
|
|
866
859
|
const keys = [...optionMap.keys()].sort((a, b) => a - b);
|
|
867
860
|
if (keys.length < 2 || keys[0] !== 1) return null;
|
|
868
861
|
return { question, options: keys.map((k) => optionMap.get(k)) };
|
|
@@ -933,7 +926,7 @@ var OutputService = class _OutputService {
|
|
|
933
926
|
return;
|
|
934
927
|
}
|
|
935
928
|
const lines = renderToLines(this.rawBuffer);
|
|
936
|
-
const selector = detectSelector(
|
|
929
|
+
const selector = detectSelector(lines);
|
|
937
930
|
if (selector) {
|
|
938
931
|
const idleMs2 = this.lastPushTime > 0 ? now - this.lastPushTime : elapsed;
|
|
939
932
|
if (idleMs2 >= _OutputService.SELECTOR_IDLE_MS) {
|
|
@@ -962,7 +955,7 @@ var OutputService = class _OutputService {
|
|
|
962
955
|
}
|
|
963
956
|
finalize() {
|
|
964
957
|
const lines = renderToLines(this.rawBuffer);
|
|
965
|
-
const selector = detectSelector(
|
|
958
|
+
const selector = detectSelector(lines);
|
|
966
959
|
this.stopPoll();
|
|
967
960
|
this.active = false;
|
|
968
961
|
if (selector) {
|