{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "AgentWorkbenchNavigationViewModel"
    },
    "activeTab": {
      "default": "sessions",
      "type": "string",
      "enum": [
        "agents",
        "sessions"
      ]
    },
    "searchQuery": {
      "default": "",
      "type": "string"
    },
    "selectedAgentItem": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "selectedSessionItem": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "agents": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "loading",
            "ready",
            "error"
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "iconUrl": {
                "type": "string",
                "format": "uri"
              },
              "builtIn": {
                "default": false,
                "type": "boolean"
              },
              "pinned": {
                "default": false,
                "type": "boolean"
              },
              "pinPending": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "builtIn",
              "pinned",
              "pinPending"
            ],
            "additionalProperties": false
          }
        },
        "error": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "items"
      ],
      "additionalProperties": false
    },
    "sessions": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "loading",
            "ready",
            "error"
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "thumbnailUrl": {
                "type": "string",
                "format": "uri"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "chat",
                  "work"
                ]
              },
              "status": {
                "default": "idle",
                "type": "string",
                "enum": [
                  "idle",
                  "running",
                  "completed",
                  "error"
                ]
              },
              "pinned": {
                "default": false,
                "type": "boolean"
              },
              "contextUsage": {
                "type": "object",
                "properties": {
                  "usedTokens": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "usedTokens",
                  "maxTokens"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "title",
              "updatedAt",
              "status",
              "pinned"
            ],
            "additionalProperties": false
          }
        },
        "error": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "items"
      ],
      "additionalProperties": false
    },
    "capabilities": {
      "type": "object",
      "properties": {
        "createAgent": {
          "default": false,
          "type": "boolean"
        },
        "createSession": {
          "default": true,
          "type": "boolean"
        },
        "manageCapabilities": {
          "default": false,
          "type": "boolean"
        },
        "manageAgentSettings": {
          "default": false,
          "type": "boolean"
        },
        "pinAgents": {
          "default": false,
          "type": "boolean"
        },
        "pinSessions": {
          "default": false,
          "type": "boolean"
        },
        "renameSessions": {
          "default": false,
          "type": "boolean"
        },
        "deleteSessions": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "createAgent",
        "createSession",
        "manageCapabilities",
        "manageAgentSettings",
        "pinAgents",
        "pinSessions",
        "renameSessions",
        "deleteSessions"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "contract",
    "activeTab",
    "searchQuery",
    "agents",
    "sessions",
    "capabilities"
  ],
  "additionalProperties": false,
  "$id": "https://schemas.infmonkeys.com/contracts/agent-workbench-navigation-view-model.schema.json",
  "title": "agent-workbench-navigation-view-model"
}
