{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.corva.ai/fe-ai-tools/app-manifest/v1",
  "title": "Ask Corva app-tools manifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "repository",
    "appKey",
    "profile",
    "toolRoots",
    "contractRevision",
    "canonRevision",
    "verification"
  ],
  "properties": {
    "$schema": { "type": "string" },
    "schemaVersion": { "const": 1 },
    "repository": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
    },
    "appKey": {
      "type": "string",
      "pattern": "^[a-z0-9_]+(?:\\.[a-z0-9_]+)+$"
    },
    "profile": { "enum": ["dc-app", "platform-app"] },
    "toolRoots": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._@/-]+$"
      }
    },
    "contractRevision": { "type": "integer", "minimum": 1 },
    "canonRevision": { "type": "integer", "minimum": 1 },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["command"],
      "properties": {
        "command": {
          "type": "string",
          "pattern": "^(yarn ai-tools:verify|npm run ai-tools:verify|pnpm ai-tools:verify)$"
        }
      }
    }
  }
}
