{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.kosmoy.com/resources/enterprise-ai-controls/v1/inventory.schema.json",
  "title": "Synthetic AI inventory walkthrough input \u2014 not a Kosmoy API",
  "type": "object",
  "required": [
    "version",
    "synthetic",
    "as_of",
    "max_source_age_days",
    "agents",
    "requests"
  ],
  "properties": {
    "version": {
      "const": "1.0.0"
    },
    "synthetic": {
      "const": true
    },
    "as_of": {
      "type": "string",
      "format": "date-time"
    },
    "max_source_age_days": {
      "type": "integer",
      "minimum": 1
    },
    "agents": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/agent"
      }
    },
    "requests": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/request"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "money": {
      "type": "integer",
      "minimum": 0
    },
    "agent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "owner",
        "purpose",
        "source",
        "last_seen",
        "status",
        "allowed_tools",
        "budget_cents",
        "spent_cents"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "owner": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "\\S"
        },
        "purpose": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "last_seen": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "enum": [
            "discovered",
            "approved",
            "retired"
          ]
        },
        "allowed_tools": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          }
        },
        "budget_cents": {
          "$ref": "#/$defs/money"
        },
        "spent_cents": {
          "$ref": "#/$defs/money"
        }
      }
    },
    "request": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "agent_id",
        "tool",
        "estimated_cost_cents"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "agent_id": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "tool": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "estimated_cost_cents": {
          "$ref": "#/$defs/money"
        }
      }
    }
  }
}
