callwalkietalkie 0.9.1 → 0.9.2
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/package.json
CHANGED
package/runtime/agent_ui.html
CHANGED
|
@@ -874,7 +874,7 @@
|
|
|
874
874
|
}
|
|
875
875
|
if (!line.trim()) { flushPara([]); i++; continue; }
|
|
876
876
|
var para = [];
|
|
877
|
-
while (i < lines.length && lines[i].trim() &&
|
|
877
|
+
while (i < lines.length && lines[i].trim() && !/^```([\w-]*)\s*$/.test(lines[i])) {
|
|
878
878
|
para.push(lines[i]); i++;
|
|
879
879
|
}
|
|
880
880
|
flushPara(para);
|
|
@@ -840,8 +840,52 @@ def _strip_assistant_line(line: str) -> str:
|
|
|
840
840
|
return line.rstrip()
|
|
841
841
|
|
|
842
842
|
|
|
843
|
+
def _parse_codex_screen(text: str) -> list[ChatMessage]:
|
|
844
|
+
"""Parse explicit Codex turn markers without relying on terminal padding."""
|
|
845
|
+
out: list[ChatMessage] = []
|
|
846
|
+
role, kind = "assistant", "message"
|
|
847
|
+
block: list[str] = []
|
|
848
|
+
|
|
849
|
+
def flush():
|
|
850
|
+
body = "\n".join(block).strip()
|
|
851
|
+
block.clear()
|
|
852
|
+
if body:
|
|
853
|
+
out.append(ChatMessage(role=role, kind=kind, text=body))
|
|
854
|
+
|
|
855
|
+
for line in text.splitlines():
|
|
856
|
+
if line.startswith("›"):
|
|
857
|
+
flush()
|
|
858
|
+
role, kind = "user", "message"
|
|
859
|
+
value = line[1:].strip()
|
|
860
|
+
if value and value != "Ask Codex to do anything":
|
|
861
|
+
block.append(value)
|
|
862
|
+
continue
|
|
863
|
+
if line.startswith(("• ", "✔ ", "✗ ")):
|
|
864
|
+
flush()
|
|
865
|
+
value = line[2:].strip()
|
|
866
|
+
role = "assistant"
|
|
867
|
+
kind = "command" if line.startswith(("✔ ", "✗ ")) or re.match(
|
|
868
|
+
r"^(Ran|Running|Explored|Edited|Read|Searched|Updated Plan|Called)\b", value
|
|
869
|
+
) else "message"
|
|
870
|
+
if "esc to interrupt" not in value:
|
|
871
|
+
block.append(value)
|
|
872
|
+
continue
|
|
873
|
+
if "esc to interrupt" in line or re.match(r"^\s*gpt-[\w.-]+.*·", line):
|
|
874
|
+
flush()
|
|
875
|
+
continue
|
|
876
|
+
if line.strip() and set(line.strip()) <= {"─", "━", "-"}:
|
|
877
|
+
flush()
|
|
878
|
+
continue
|
|
879
|
+
# Wrapped turns use two spaces; preserve deeper code indentation.
|
|
880
|
+
block.append(line[2:] if line.startswith(" ") else line)
|
|
881
|
+
flush()
|
|
882
|
+
return out
|
|
883
|
+
|
|
884
|
+
|
|
843
885
|
def parse_screen(text: str) -> list[ChatMessage]:
|
|
844
886
|
"""Turn a cmux terminal dump into chat + command blocks."""
|
|
887
|
+
if re.search(r"^›", text, re.M) and re.search(r"^• ", text, re.M):
|
|
888
|
+
return _parse_codex_screen(text)
|
|
845
889
|
out: list[ChatMessage] = []
|
|
846
890
|
abuf: list[str] = []
|
|
847
891
|
ubuf: list[str] = []
|