getCleanupInfo 获取清理信息
(task *TaskInfo)
| 292 | |
| 293 | // getCleanupInfo 获取清理信息 |
| 294 | func (t *KillShellTool) getCleanupInfo(task *TaskInfo) map[string]any { |
| 295 | if task == nil || task.Options == nil { |
| 296 | return map[string]any{ |
| 297 | "files_cleared": 0, |
| 298 | "cleanup_method": "not_available", |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | return map[string]any{ |
| 303 | "output_file": fmt.Sprintf("%s/%s.stdout", task.Options.OutputDir, task.ID), |
| 304 | "error_file": fmt.Sprintf("%s/%s.stderr", task.Options.OutputDir, task.ID), |
| 305 | "task_file": fmt.Sprintf("%s/%s.json", "/tmp/agentsdk_tasks", task.ID), |
| 306 | "files_cleared": 3, |
| 307 | "cleanup_method": "file_truncate_and_remove", |
| 308 | "cleanup_timestamp": time.Now().Unix(), |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | func (t *KillShellTool) Prompt() string { |
| 313 | return `终止后台运行的shell进程。 |