Move the Claude Code internals from --help beside the modules relying on them

This commit is contained in:
2026-09-28 16:52:30 +02:00
parent 1be6ae8187
commit 44cf712dc8
8 changed files with 8 additions and 14 deletions
+2
View File
@@ -42,6 +42,7 @@ def parts(entry):
return found if isinstance(found, list) else []
# Claude Code 2.1.282 writes "user" entries of its own, a claude -p prompt among them.
def user_entry_kind(entry):
if entry.get("isMeta"):
return UserEntryKind.META
@@ -77,6 +78,7 @@ def render(entries):
return "\n\n".join(lines)
# An "assistant" entry's parts, alike in the transcript and in stream-json on Claude Code 2.1.282.
def said(part, limit=400):
kind = part.get("type") if isinstance(part, dict) else None
if kind == "text" and isinstance(part.get("text"), str) and part["text"].strip():