()
| 84 | } |
| 85 | |
| 86 | func (n TaskNotification) ToMessage() map[string]any { |
| 87 | usage, _ := json.Marshal(n.Usage) |
| 88 | text := fmt.Sprintf("<task-notification>\nnotification_id: %s\ntask_id: %s\nparent_task_id: %s\nparent_scope_id: %s\nstatus: %s\nsummary: %s\nresult: %s\nusage: %s\n</task-notification>", |
| 89 | n.NotificationID, n.TaskID, n.ParentTaskID, n.ParentScopeID, n.Status, n.Summary, n.Result, string(usage)) |
| 90 | return map[string]any{ |
| 91 | "role": "user", |
| 92 | "content": []map[string]any{{"type": "text", "text": text}}, |
| 93 | "isMeta": true, |
| 94 | "metadata": map[string]any{ |
| 95 | "source": "task_notification", |
| 96 | "task_id": n.TaskID, |
| 97 | "notification_id": n.NotificationID, |
| 98 | "parent_task_id": nilIfEmpty(n.ParentTaskID), |
| 99 | "parent_scope_id": n.ParentScopeID, |
| 100 | "status": n.Status, |
| 101 | }, |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | type AgentTaskRuntime struct { |
| 106 | mu sync.Mutex |
no test coverage detected