{
    "AutoStockpileDecisionWuling": {
        "desc": "统一识别与决策：CustomRecognition识别商品，CustomAction选择购买",
        "recognition": {
            "type": "Custom",
            "param": {
                "custom_recognition": "AutoStockpile.Recognition",
                "custom_recognition_param": {}
            }
        },
        "pre_delay": 0,
        "action": {
            "type": "Custom",
            "param": {
                "custom_action": "AutoStockpile.SelectItem",
                "custom_action_param": {
                    "Region": "Wuling"
                }
            }
        },
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileClearDecisionHitCount"
        ]
    },
    "AutoStockpileDecisionValleyIV": {
        "desc": "统一识别与决策：CustomRecognition识别商品，CustomAction选择购买",
        "recognition": {
            "type": "Custom",
            "param": {
                "custom_recognition": "AutoStockpile.Recognition",
                "custom_recognition_param": {}
            }
        },
        "pre_delay": 0,
        "action": {
            "type": "Custom",
            "param": {
                "custom_action": "AutoStockpile.SelectItem",
                "custom_action_param": {
                    "Region": "ValleyIV"
                }
            }
        },
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileClearDecisionHitCount"
        ]
    },
    "AutoStockpileDecisionAttach": {
        "desc": "承载 AutoStockpile 决策配置的固定合同节点；任务选项 attach 写入此处，供 Go 服务统一读取，请勿随意改名或删除(临时方案)"
    },
    "AutoStockpileClearDecisionHitCount": {
        "desc": "清除中继节点MaxHit",
        "pre_delay": 0,
        "action": {
            "type": "Custom",
            "param": {
                "custom_action": "ClearHitCount",
                "custom_action_param": {
                    "nodes": [
                        "AutoStockpileRelayNodeDecision"
                    ]
                }
            }
        },
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileRelayNodeDecision"
        ]
    },
    "AutoStockpileRelayNodeDecision": {
        "desc": "限制复核重试次数",
        "max_hit": 4,
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileSelectedGoodsClick",
            "AutoStockpileSkip"
        ]
    },
    "AutoStockpileSelectedGoodsClick": {
        "desc": "点击决策选中的商品 (template)",
        "enabled": false,
        "recognition": {
            "type": "TemplateMatch",
            "param": {
                "roi": [
                    50,
                    180,
                    1200,
                    500
                ],
                "template": [
                    "AutoStockpile/StockRedistributionButton.png"
                ],
                "threshold": [
                    0.8
                ]
            }
        },
        "pre_delay": 0,
        "action": {
            "type": "Click",
            "param": {}
        },
        "post_wait_freezes": 80,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileEnsureDetailFrameStable"
        ]
    },
    "AutoStockpileEnsureDetailFrameStable": {
        "desc": "确保详情页已经加载完成",
        "recognition": {
            "type": "And",
            "param": {
                "all_of": [
                    "CloseButtonType1"
                ]
            }
        },
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileReconcileDecision"
        ]
    },
    "AutoStockpileBackToSelection": {
        "desc": "返回选择界面，准备下一轮决策",
        "recognition": {
            "type": "And",
            "param": {
                "all_of": [
                    "CloseButtonType1"
                ]
            }
        },
        "pre_delay": 0,
        "action": {
            "type": "Click",
            "param": {}
        },
        "post_wait_freezes": 80,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileRelayNodeDecision",
            "AutoStockpileDecisionFailed"
        ]
    },
    "AutoStockpileSkip": {
        "desc": "决策未找到合格商品或提前结束",
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileBackToRegionalConstruction"
        ],
        "focus": {
            "Node.Recognition.Succeeded": "跳过本次购买"
        }
    },
    "AutoStockpileDecisionFailed": {
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0,
        "next": [
            "AutoStockpileBackToRegionalConstruction"
        ],
        "focus": {
            "Node.Recognition.Starting": "<span style=\"color: orange\">⚠️超过最大复核重试次数，已跳过地区</span>"
        }
    },
    "AutoStockpileReconcilePriceFilter": {
        "desc": "过滤调度券图标",
        "recognition": {
            "type": "ColorMatch",
            "param": {
                "method": 40,
                "lower": [
                    [
                        0,
                        0,
                        40
                    ]
                ],
                "upper": [
                    [
                        5,
                        5,
                        120
                    ]
                ]
            }
        },
        "pre_delay": 0,
        "post_delay": 0,
        "rate_limit": 0
    },
    "AutoStockpileReconcileDecision": {
        "desc": "根据详情页价格校正并重算决策",
        "recognition": {
            "type": "OCR",
            "param": {
                "roi": [
                    1000,
                    244,
                    80,
                    20
                ],
                "expected": [
                    "\\d{3,4}"
                ],
                "replace": [
                    [
                        "[^\\d]",
                        ""
                    ]
                ],
                "color_filter": "AutoStockpileReconcilePriceFilter"
            }
        },
        "pre_delay": 0,
        "action": {
            "type": "Custom",
            "param": {
                "custom_action": "AutoStockpile.ReconcileDecision"
            }
        },
        "post_delay": 0,
        "timeout": 5000,
        "rate_limit": 0,
        "next": [
            "AutoStockpileRelayNodeDecisionReady",
            "AutoStockpileBackToSelection"
        ]
    }
}
