Move the Claude Code internals from --help beside the modules relying on them
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user