写入文件内容(简化版)。 对应源码: rust/crates/runtime/src/file_ops.rs
(params: dict)
| 181 | |
| 182 | |
| 183 | def execute_write_file(params: dict) -> str: |
| 184 | """ |
| 185 | 写入文件内容(简化版)。 |
| 186 | 对应源码: rust/crates/runtime/src/file_ops.rs |
| 187 | """ |
| 188 | path = params["path"] |
| 189 | content = params["content"] |
| 190 | |
| 191 | try: |
| 192 | with open(path, "w", encoding="utf-8") as f: |
| 193 | f.write(content) |
| 194 | return f"Successfully wrote {len(content)} chars to {path}" |
| 195 | except Exception as e: |
| 196 | return f"[error] {e}" |
| 197 | |
| 198 | |
| 199 | def execute_grep(params: dict) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected