#!/usr/bin/env python3
"""
Submit Jimeng AI tool task to CodingAgent
"""
import asyncio
from pathlib import Path
from tool_agent.tool.agent import CodingAgent

async def main():
    # Read task spec
    task_spec_path = Path(__file__).parent.parent / "task_specs" / "jimeng_ai_task.md"
    task_spec = task_spec_path.read_text(encoding="utf-8")

    # Create CodingAgent instance
    agent = CodingAgent()

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

    # Execute task
    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())
