{
  "name": "admin_pool",
  "title": "管理器实例池自省",
  "description": "基于 mm_admin 的实例池能力：列出当前进程内已注册的 Admin 实例名、判断某个实例是否存在、查看实例内已缓存的实例数量、设置全局密钥或注销实例。适用场景：排查管理器实例为何取不到、确认模块是否已注册、清理实例池。",
  "category": "内核运行时",
  "group": "kernel",
  "type": "function",
  "main": "./index.js",
  "params": {
    "type": "object",
    "properties": {
      "action": {
        "type": "string",
        "description": "操作类型: registry(已注册实例)/inspect(查看实例)/secret(设置密钥)/unreg(注销实例)",
        "enum": [
          "registry",
          "inspect",
          "secret",
          "unreg"
        ],
        "default": "registry"
      },
      "name": {
        "type": "string",
        "description": "实例名称(inspect/unreg 必填)"
      },
      "secret": {
        "type": "string",
        "description": "全局密钥(secret/unreg 必填)，只允许设置一次"
      },
      "scope": {
        "type": "string",
        "description": "作用域(inspect 可选)，缺省取该实例已缓存的全部键"
      }
    },
    "required": [
      "action"
    ]
  },
  "returns": {
    "type": "object",
    "properties": {
      "code": {
        "type": "number",
        "description": "0 表示成功，1xxxx 表示业务/执行异常"
      },
      "msg": {
        "type": "string",
        "description": "结果描述"
      },
      "registry": {
        "type": "array",
        "description": "已注册实例名列表"
      },
      "count": {
        "type": "number",
        "description": "数量"
      },
      "exists": {
        "type": "boolean",
        "description": "实例是否存在"
      },
      "keys": {
        "type": "array",
        "description": "该实例已缓存的键(inspect)"
      },
      "ok": {
        "type": "boolean",
        "description": "操作是否成功"
      },
      "error": {
        "type": "object",
        "description": "异常对象 { name, message }"
      }
    }
  },
  "handler": "manager"
}
