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

Function taskRecordFromMap

agent/task_runtime.go:947–970  ·  view source on GitHub ↗
(data map[string]any)

Source from the content-addressed store, hash-verified

945}
946
947func taskRecordFromMap(data map[string]any) *AgentTaskRecord {
948 b, _ := json.Marshal(data)
949 record := &AgentTaskRecord{}
950 _ = json.Unmarshal(b, record)
951 if record.TaskID == "" {
952 record.TaskID = fmt.Sprintf("task-%s", uuid.NewString()[:8])
953 }
954 if record.ParentScopeID == "" {
955 record.ParentScopeID = "main"
956 }
957 if record.AgentType == "" {
958 record.AgentType = "general-purpose"
959 }
960 if record.Status == "" {
961 record.Status = "interrupted"
962 }
963 if record.CreatedAt == 0 {
964 record.CreatedAt = nowSeconds()
965 }
966 if record.UpdatedAt == 0 {
967 record.UpdatedAt = nowSeconds()
968 }
969 return record
970}
971
972func firstNonEmptyString(values ...string) string {
973 for _, value := range values {

Callers 1

ImportSnapshotMethod · 0.85

Calls 1

nowSecondsFunction · 0.70

Tested by

no test coverage detected