{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tianheluo.com/schema/plugin.schema.json",
  "title": "天河落 THL 插件清单 plugin.json",
  "description": "社区（Python）插件的 plugin.json。规范全文：https://tianheluo.com/ai.md",
  "type": "object",
  "required": ["id", "name", "version", "description", "category", "revit", "type", "script", "author", "license"],
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{2,40}$",
      "description": "小写字母/数字/连字符，3-41 字符；全平台唯一；发布后不要改"
    },
    "name": { "type": "string", "minLength": 1, "maxLength": 20, "description": "显示名" },
    "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$", "description": "语义化版本；更新时必须递增" },
    "description": { "type": "string", "minLength": 1, "maxLength": 400, "description": "第一行是一句话摘要" },
    "category": { "enum": ["市政管线", "出图打印", "数据处理", "建模辅助", "视图管理", "导出", "其他"] },
    "revit": { "const": "2026" },
    "type": { "const": "python", "description": "社区插件只接受 python" },
    "script": { "type": "string", "pattern": "^[^/\\\\]+\\.py$", "description": "入口脚本文件名，不含路径" },
    "author": { "type": "string", "minLength": 1 },
    "license": {
      "enum": ["MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "ISC", "Unlicense", "CC0-1.0", "0BSD",
               "GPL-2.0-only", "GPL-2.0-or-later", "GPL-3.0-only", "GPL-3.0-or-later",
               "LGPL-2.1-only", "LGPL-2.1-or-later", "LGPL-3.0-only", "LGPL-3.0-or-later", "MPL-2.0", "AGPL-3.0-only"]
    },
    "glyph": { "type": "string", "minLength": 1, "maxLength": 3, "description": "图标上显示的 1-3 个字符" },
    "color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
    "homepage": { "type": "string", "pattern": "^https?://" },
    "hostApi": { "const": 1, "description": "宿主接口版本；目前只有 1，缺省即 1" },
    "network": { "type": "boolean", "default": false, "description": "需要联网才填 true，并在 README 说明" }
  }
}
