
___x_cmd_ps___ai(){
    local IFS=" "
    local text="$*"
    local data; data="$(LC_TIME="$___X_CMD_LOCALE_DEF_C" command ps aux | head -n 80)"

    local idlist; idlist="$( text="$text" x chat --request --type ps --minion "$___X_CMD_ROOT_MOD/ps/lib/minion/ai.yml" "$(printf "%s\n" "$data" | ___x_cmd_ps___tocsv | x csv tab - 1:10)")"

    echo "id ==> $idlist" >/dev/tty

    printf "%s\n" "$data" | ___x_cmd_cmds_awk -v idlist="$idlist" '
        BEGIN{
            split(idlist, arr, " ")
            for (id in arr) idmap[ arr[id] ] = 1
        }

        NR==1{
            print
            next
        }

        (idmap[$2] == 1){ print }
    ' | {
        case "${fmt:-app}" in
            csv)        ___x_cmd_ps___tocsv   ;;
            json)       ___x_cmd_ps___tojson  ;;
            app)        ___x_cmd_ps___toapp   ;;
            *)          ___x_cmd_cmds_cat   ;;
        esac
    }
}

# ___x_cmd_ps___ai_tailess(){
#     ___x_cmd_cmds_awk '{
#         printf("%s\t", $1)
#         printf("%s\t", $2)
#         printf("%s\t", $3)
#         printf("%s\t", $4)
#         printf("%s\t", $5)
#         printf("%s\t", $6)
#         printf("%s\t", $7)
#         printf("%s\t", $8)
#         printf("%s\t", $9)
#         printf("%s\t", $10)
#         printf("\n")
#     }'
# }

# x ps =    give the ps list which take major heavy load of cpu and memory
# x ps ,    give the ps list which take major heavy load of cpu and memory

___x_cmd_ps___co(){
    :
}

