#!/bin/bash
# 任务名称：飞书问题反馈 P0 实时分发到群（步骤7，仅P0）
# 执行时间：每分钟
# 归属 Agent：小葵 xiaokui

set -e

export PATH=/root/.nvm/versions/node/v24.14.0/bin:$PATH
LOG_FILE="/var/log/xiaokui_feedback_dispatch_p0.log"

log() {
    echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1" >> "$LOG_FILE"
}

log "=== P0 实时分发开始 ==="

cd /root/.openclaw/workspace-xiaokui
python3 skills/feishu-feedback-sync/scripts/sync_feishu_feedback.py --days 1 --steps 7 --dispatch-mode p0 >> "$LOG_FILE" 2>&1

log "=== P0 实时分发结束 ==="
exit 0
