{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bamf-ai/json-schema/bamf-ai-agent-route-data-response-schema.json",
  "title": "AgentRouteDataResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bamf-ai-agent-api-openapi.yml#/components/schemas/AgentRouteDataResponse",
  "type": "object",
  "required": [
    "schema",
    "operation_ref",
    "data",
    "receipt"
  ],
  "properties": {
    "schema": {
      "const": "bamf.operation-result/v1"
    },
    "operation_ref": {
      "const": "bamf.agent.route.propose/v1"
    },
    "data": {
      "$ref": "#/$defs/AgentRouteResponse"
    },
    "receipt": {
      "$ref": "#/$defs/AgentProposalReceipt"
    }
  },
  "$defs": {
    "AgentProposalReceipt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema",
        "kind",
        "operation_ref",
        "status",
        "executed",
        "execution_requires_separate_operation"
      ],
      "properties": {
        "schema": {
          "const": "bamf.operation-receipt/v1"
        },
        "kind": {
          "const": "proposal"
        },
        "operation_ref": {
          "const": "bamf.agent.route.propose/v1"
        },
        "status": {
          "const": "proposed"
        },
        "executed": {
          "const": false
        },
        "execution_requires_separate_operation": {
          "const": true
        }
      }
    },
    "AgentRouteClarification": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "required"
      ],
      "properties": {
        "required": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "question": {
          "type": "string"
        }
      }
    },
    "AgentRouteRecommendation": {
      "type": "object",
      "properties": {
        "workflow_id": {
          "type": "string"
        },
        "bamf_stack_skill": {
          "type": [
            "string",
            "null"
          ]
        },
        "rest": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mcp": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "required_scopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mutation_policy": {
          "type": "string"
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "score": {
          "type": "number"
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ordered_steps": {
          "type": "array",
          "description": "Ordered proposal steps for compound requests; each step remains non-executing.",
          "items": {
            "$ref": "#/$defs/AgentRouteStep"
          }
        },
        "clarification": {
          "$ref": "#/$defs/AgentRouteClarification"
        },
        "approval_required_before_writes": {
          "type": "boolean"
        },
        "research_recommended": {
          "type": "boolean"
        },
        "research_trigger_terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mini_interview_recommended": {
          "type": "boolean"
        },
        "mini_interview_trigger_terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AgentRouteRequest": {
      "type": "object",
      "properties": {
        "request": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "intent": {
          "type": "string"
        },
        "app_intent": {
          "type": "string"
        },
        "workflow_id": {
          "type": "string"
        },
        "visual_type": {
          "type": "string"
        },
        "post_id": {
          "type": "string"
        },
        "current_post_id": {
          "type": "string"
        },
        "has_post_id": {
          "type": "boolean"
        },
        "wants_to_mutate": {
          "type": "boolean"
        },
        "context": {
          "$ref": "#/$defs/JSONValue"
        }
      }
    },
    "AgentRouteResponse": {
      "type": "object",
      "properties": {
        "service": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "request": {
          "$ref": "#/$defs/AgentRouteRequest"
        },
        "recommended": {
          "$ref": "#/$defs/AgentRouteRecommendation"
        },
        "alternatives": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentRouteRecommendation"
          }
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AgentRouteStep": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "step",
        "workflow_id",
        "depends_on"
      ],
      "properties": {
        "step": {
          "type": "integer",
          "minimum": 1
        },
        "workflow_id": {
          "type": "string"
        },
        "depends_on": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1
          }
        }
      }
    },
    "JSONValue": {
      "description": "Any JSON value returned by flexible workflow, analytics, context, or generation payloads."
    }
  }
}