(value any, preview string)
| 5955 | } |
| 5956 | |
| 5957 | func structuredNetworkResult(value any, preview string) (toolspkg.ToolResult, error) { |
| 5958 | result, err := structuredResult(value, preview) |
| 5959 | if err != nil { |
| 5960 | return toolspkg.ToolResult{}, err |
| 5961 | } |
| 5962 | redactedStructured := json.RawMessage(taskpkg.RedactClaimTokens(string(result.Structured))) |
| 5963 | if !json.Valid(redactedStructured) { |
| 5964 | return toolspkg.ToolResult{}, errors.New("daemon: redacted network tool result is invalid JSON") |
| 5965 | } |
| 5966 | result.Structured = redactedStructured |
| 5967 | result.Preview = strings.TrimSpace(taskpkg.RedactClaimTokens(result.Preview)) |
| 5968 | for idx := range result.Content { |
| 5969 | result.Content[idx].Text = taskpkg.RedactClaimTokens(result.Content[idx].Text) |
| 5970 | } |
| 5971 | return result, nil |
| 5972 | } |
| 5973 | |
| 5974 | func actorContextFromScope(scope toolspkg.Scope) (taskpkg.ActorContext, error) { |
| 5975 | if sessionID := strings.TrimSpace(scope.SessionID); sessionID != "" { |
no test coverage detected