(path: str, limit: int = None)
| 141 | return "Error: Timeout (120s)" |
| 142 | |
| 143 | def run_read(path: str, limit: int = None) -> str: |
| 144 | try: |
| 145 | lines = safe_path(path).read_text().splitlines() |
| 146 | if limit and limit < len(lines): |
| 147 | lines = lines[:limit] + [f"... ({len(lines) - limit} more)"] |
| 148 | return "\n".join(lines)[:50000] |
| 149 | except Exception as e: |
| 150 | return f"Error: {e}" |
| 151 | |
| 152 | def run_write(path: str, content: str) -> str: |
| 153 | try: |
no test coverage detected