param(
    [Parameter(Mandatory=$true)][string]$text
)

# 生成 MP3（中文女声）
# 使用 node‑edge‑tts，输出到临时文件
$mp3Path = "$env:TEMP\report.mp3"
node-edge-tts --text $text --voice zh-CN-XiaoxiaoNeural --output $mp3Path

# 调用 upload.py 进行上传
$skillDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$uploadScript = Join-Path $skillDir "..\upload.py"
$uploadedUrl = python $uploadScript $mp3Path

# 输出最终 URL（若上传失败则输出空）
Write-Output $uploadedUrl
