mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-06-21 04:33:36 +08:00
Merge pull request #322 from hardness1020/fix/extract-text-placement
fix(s06): move extract_text() next to its only caller
This commit is contained in:
@@ -136,12 +136,6 @@ def run_todo_write(todos: list) -> str:
|
||||
print("\n".join(lines))
|
||||
return f"Updated {len(CURRENT_TODOS)} tasks"
|
||||
|
||||
def extract_text(content) -> str:
|
||||
"""Extract text from message content blocks."""
|
||||
if not isinstance(content, list):
|
||||
return str(content)
|
||||
return "\n".join(getattr(b, "text", "") for b in content if getattr(b, "type", None) == "text")
|
||||
|
||||
TOOLS = [
|
||||
{"name": "bash", "description": "Run a shell command.",
|
||||
"input_schema": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}},
|
||||
@@ -186,6 +180,12 @@ SUB_HANDLERS = {
|
||||
"edit_file": run_edit, "glob": run_glob,
|
||||
}
|
||||
|
||||
def extract_text(content) -> str:
|
||||
"""Extract text from message content blocks."""
|
||||
if not isinstance(content, list):
|
||||
return str(content)
|
||||
return "\n".join(getattr(b, "text", "") for b in content if getattr(b, "type", None) == "text")
|
||||
|
||||
def spawn_subagent(description: str) -> str:
|
||||
"""Spawn a subagent with fresh messages[], return summary only."""
|
||||
print(f"\n\033[35m[Subagent spawned]\033[0m")
|
||||
|
||||
Reference in New Issue
Block a user