{
  "name": "os_status",
  "title": "系统状态",
  "description": "调用 mm_os 获取进程健康快照、入站适配器就绪状态、运行状态与关键配置，并支持运行期模块安装/卸载/重载。适用场景：健康检查、排查端口未监听、确认当前实例作用域与加载器配置、热更新模块。工作流提示：health 看进程存活，readiness 看能否接流量，status 看实例是否已启动，module_install/module_unload/module_reload 走模块通道热操作。",
  "category": "系统内核",
  "group": "kernel",
  "type": "function",
  "main": "./index.js",
  "params": {
    "type": "object",
    "properties": {
      "action": {
        "type": "string",
        "description": "操作类型: health 健康 / readiness 就绪 / status 运行状态 / config 关键配置 / module_install 安装模块 / module_unload 卸载模块 / module_reload 热重载模块",
        "enum": ["health", "readiness", "status", "config", "module_install", "module_unload", "module_reload"],
        "default": "health"
      },
      "module": {
        "type": "string",
        "description": "模块包名(module_install/module_unload/module_reload 必填)"
      },
      "options": {
        "type": "object",
        "description": "安装选项(module_install 使用，透传 force/version/load 等)"
      },
      "scope": {
        "type": "string",
        "description": "系统实例作用域，缺省 os",
        "default": "os"
      }
    },
    "required": ["action"]
  },
  "returns": {
    "type": "object",
    "properties": {
      "code": { "type": "number", "description": "0 表示成功" },
      "msg": { "type": "string", "description": "结果描述" },
      "health": { "type": "object", "description": "健康快照" },
      "readiness": { "type": "object", "description": "就绪状态" },
      "name": { "type": "string", "description": "实例名称" },
      "scope": { "type": "string", "description": "实例作用域" },
      "running": { "type": "boolean", "description": "是否处于运行态" },
      "state": { "type": "string", "description": "生命周期状态" },
      "warming": { "type": "boolean", "description": "是否预热中" },
      "module": { "type": "string", "description": "操作的模块包名" },
      "count": { "type": "number", "description": "安装/卸载/重载涉及的注册项数量" },
      "names": { "type": "array", "items": { "type": "string" }, "description": "安装/卸载/重载涉及的注册名列表" },
      "error": { "type": "object", "description": "异常信息" }
    }
  },
  "handler": "manager"
}
