MCPcopy Create free account
hub / github.com/compozy/agh / normalizeCreateTaskSpec

Function normalizeCreateTaskSpec

internal/task/manager.go:2551–2579  ·  view source on GitHub ↗
(spec CreateTask)

Source from the content-addressed store, hash-verified

2549}
2550
2551func normalizeCreateTaskSpec(spec CreateTask) (CreateTask, error) {
2552 normalized := spec
2553 normalized.ID = strings.TrimSpace(normalized.ID)
2554 normalized.Identifier = strings.TrimSpace(normalized.Identifier)
2555 normalized.Scope = normalized.Scope.Normalize()
2556 normalized.WorkspaceID = strings.TrimSpace(normalized.WorkspaceID)
2557 normalized.ParentTaskID = strings.TrimSpace(normalized.ParentTaskID)
2558 normalized.NetworkChannel = strings.TrimSpace(normalized.NetworkChannel)
2559 normalized.Title = strings.TrimSpace(normalized.Title)
2560 normalized.Description = strings.TrimSpace(normalized.Description)
2561 normalized.Priority = normalizePriorityOrDefault(normalized.Priority)
2562 if normalized.MaxAttempts != nil {
2563 maxAttempts := *normalized.MaxAttempts
2564 normalized.MaxAttempts = &maxAttempts
2565 }
2566 if normalized.WakeCreator != nil {
2567 wakeCreator := *normalized.WakeCreator
2568 normalized.WakeCreator = &wakeCreator
2569 }
2570 normalized.ApprovalPolicy = normalizeApprovalPolicyOrDefault(normalized.ApprovalPolicy)
2571 if normalized.Owner != nil {
2572 normalized.Owner = normalizeOwnership(normalized.Owner)
2573 }
2574 normalized.Metadata = normalizeRawJSON(normalized.Metadata)
2575 if err := normalized.Validate("create_task"); err != nil {
2576 return CreateTask{}, err
2577 }
2578 return normalized, nil
2579}
2580
2581func createTaskWakeCreator(spec CreateTask) bool {
2582 if spec.WakeCreator == nil {

Callers 1

CreateTaskMethod · 0.85

Calls 6

normalizeOwnershipFunction · 0.85
normalizeRawJSONFunction · 0.70
ValidateMethod · 0.65
NormalizeMethod · 0.45

Tested by

no test coverage detected