#!/usr/bin/env python3
"""
提交快手可灵工具封装任务到CodingAgent
"""
import asyncio
from pathlib import Path
from tool_agent.tool.agent import CodingAgent

async def main():
    # 读取任务书
    task_spec_path = Path(__file__).parent.parent / "task_specs" / "kuaishou_kling_task.md"
    task_spec = task_spec_path.read_text(encoding="utf-8")

    # 创建CodingAgent实例
    agent = CodingAgent()

    print(">> Submitting Kuaishou Kling tool task...")
    print(f">> Task spec: {task_spec_path}")
    print("-" * 60)

    # 执行任务
    result = await agent.execute(
        task=task_spec,
        reference_files=None
    )

    print("-" * 60)
    print(">> Task completed!")
    print(f">> Result: {result}")

if __name__ == "__main__":
    asyncio.run(main())
