{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://triflux.dev/schema/hub/delegator-tools.schema.json",
  "title": "Triflux Delegator MCP Tool Schemas",
  "$defs": {
    "Provider": {
      "type": "string",
      "enum": ["auto", "codex", "antigravity", "gemini"]
    },
    "Mode": {
      "type": "string",
      "enum": ["sync", "async"]
    },
    "JobStatus": {
      "type": "string",
      "enum": ["queued", "running", "waiting_reply", "completed", "failed"]
    },
    "McpProfile": {
      "type": "string",
      "enum": [
        "auto",
        "default",
        "executor",
        "designer",
        "explore",
        "reviewer",
        "writer",
        "none",
        "implement",
        "analyze",
        "review",
        "docs",
        "minimal"
      ]
    },
    "SearchTool": {
      "type": "string",
      "enum": ["exa", "brave-search", "tavily"]
    },
    "NullableDateTime": {
      "type": ["string", "null"],
      "format": "date-time"
    },
    "NullableString": {
      "type": ["string", "null"]
    },
    "DelegateInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["prompt"],
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "$ref": "#/$defs/Provider",
          "default": "auto"
        },
        "mode": {
          "$ref": "#/$defs/Mode",
          "default": "sync"
        },
        "agent_type": {
          "type": "string",
          "default": "executor",
          "minLength": 1
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "timeout_ms": {
          "type": "integer",
          "minimum": 1
        },
        "session_key": {
          "type": "string",
          "minLength": 1
        },
        "thread_id": {
          "type": "string",
          "minLength": 1
        },
        "reset_session": {
          "type": "boolean",
          "default": false
        },
        "mcp_profile": {
          "$ref": "#/$defs/McpProfile",
          "default": "auto"
        },
        "search_tool": {
          "$ref": "#/$defs/SearchTool"
        },
        "context_file": {
          "type": "string",
          "minLength": 1
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "developer_instructions": {
          "type": "string",
          "minLength": 1
        },
        "compact_prompt": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "DelegateReplyInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["job_id", "reply"],
      "properties": {
        "job_id": {
          "type": "string",
          "minLength": 1
        },
        "reply": {
          "type": "string",
          "minLength": 1
        },
        "done": {
          "type": "boolean",
          "default": false
        }
      }
    },
    "StatusInput": {
      "type": "object",
      "additionalProperties": false,
      "required": ["job_id"],
      "properties": {
        "job_id": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "DelegateOutput": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ok",
        "job_id",
        "status",
        "mode",
        "provider_requested",
        "provider_resolved",
        "agent_type",
        "transport",
        "created_at",
        "started_at",
        "updated_at",
        "completed_at",
        "thread_id",
        "session_key",
        "conversation_open"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "job_id": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "$ref": "#/$defs/JobStatus"
        },
        "mode": {
          "$ref": "#/$defs/Mode"
        },
        "provider_requested": {
          "$ref": "#/$defs/Provider"
        },
        "provider_resolved": {
          "type": ["string", "null"]
        },
        "agent_type": {
          "type": "string",
          "minLength": 1
        },
        "transport": {
          "type": "string",
          "minLength": 1
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "started_at": {
          "$ref": "#/$defs/NullableDateTime"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "completed_at": {
          "$ref": "#/$defs/NullableDateTime"
        },
        "output": {
          "type": "string"
        },
        "stderr": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "thread_id": {
          "$ref": "#/$defs/NullableString"
        },
        "session_key": {
          "$ref": "#/$defs/NullableString"
        },
        "conversation_open": {
          "type": "boolean"
        }
      }
    }
  },
  "x-triflux-mcp-tools": [
    {
      "name": "delegate",
      "description": "Create a new delegator job and optionally wait for the first result.",
      "inputSchemaDef": "DelegateInput",
      "outputSchemaDef": "DelegateOutput",
      "pipeAction": "delegator_delegate"
    },
    {
      "name": "delegate-reply",
      "description": "Send a follow-up reply into an existing delegator conversation job.",
      "inputSchemaDef": "DelegateReplyInput",
      "outputSchemaDef": "DelegateOutput",
      "pipeAction": "delegator_reply"
    },
    {
      "name": "status",
      "description": "Read the latest snapshot for an existing delegator job.",
      "inputSchemaDef": "StatusInput",
      "outputSchemaDef": "DelegateOutput",
      "pipeAction": "delegator_status"
    }
  ]
}
