manifest_version: "1.0.0"
name: task_manager
display_name: 任务管理
description: 任务创建、查询、更新和状态管理
author: Jarvis
version: "1.0.0"

type: sync
runtime: python
entry: tools/implementations/task_manager.py
timeout: 10000

config_schema: {}

commands:
  - name: create_task
    description: |
      创建新任务。
      参数:
      - name (必需): 任务名称
      - description (必需): 任务描述
      - scheduled_at (可选): 计划执行时间 (ISO 格式)
    parameters:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        scheduled_at:
          type: string
          format: date-time
      required: [name, description]

  - name: list_tasks
    description: |
      列出任务。
      参数:
      - status (可选): 按状态筛选 (pending/running/completed/failed)
    parameters:
      type: object
      properties:
        status:
          type: string
          enum: [pending, running, completed, failed]

  - name: get_task
    description: |
      获取任务详情。
      参数:
      - task_id (必需): 任务 ID
    parameters:
      type: object
      properties:
        task_id:
          type: string
      required: [task_id]

  - name: complete_task
    description: |
      标记任务完成。
      参数:
      - task_id (必需): 任务 ID
      - result (必需): 执行结果
    parameters:
      type: object
      properties:
        task_id:
          type: string
        result:
          type: object
      required: [task_id, result]

  - name: fail_task
    description: |
      标记任务失败。
      参数:
      - task_id (必需): 任务 ID
      - error (必需): 错误信息
    parameters:
      type: object
      properties:
        task_id:
          type: string
        error:
          type: string
      required: [task_id, error]

tags: [task, management]
enabled: true
