MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / ToMessage

Method ToMessage

agent/task_runtime.go:86–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84}
85
86func (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
105type AgentTaskRuntime struct {
106 mu sync.Mutex

Callers 1

Calls 1

nilIfEmptyFunction · 0.85

Tested by

no test coverage detected