feat(onebot): implement online client queries
Replace the get_online_clients placeholder with the latest QQ online-device snapshot and return stable OneBot fields for client ID, device name, and localized device category. Fail explicitly when no snapshot has been observed or when callers request an unsupported fresh refresh, while preserving an observed empty snapshot as a successful result. Update SDK types and generated MCP schemas, and add action-level coverage for every state.
This commit is contained in:
7 files changed
+209
-30
No files matched your search
@@ -4985,14 +4985,42 @@ export const ACTIONS: CatalogAction[] = [
|
||||
{
|
||||
"name": "get_online_clients",
|
||||
"aliases": [],
|
||||
"summary": "获取在线客户端(占位,OneBot v11 形状)",
|
||||
"returns": "{ clients }:在线设备列表(占位,clients 恒为空数组)。",
|
||||
"summary": "获取在线客户端",
|
||||
"returns": "{ clients }:QQ 本次会话最近推送的在线设备快照。",
|
||||
"returnsSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"clients": {
|
||||
"type": "array",
|
||||
"description": "在线设备列表(占位,恒空)"
|
||||
"description": "在线设备列表",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"app_id": {
|
||||
"type": "integer",
|
||||
"description": "客户端 ID"
|
||||
},
|
||||
"device_name": {
|
||||
"type": "string",
|
||||
"description": "设备名称"
|
||||
},
|
||||
"device_kind": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"电脑",
|
||||
"Pad",
|
||||
"手机",
|
||||
"未知设备"
|
||||
],
|
||||
"description": "设备类别"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"app_id",
|
||||
"device_name",
|
||||
"device_kind"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -5000,11 +5028,28 @@ export const ACTIONS: CatalogAction[] = [
|
||||
]
|
||||
},
|
||||
"readOnly": true,
|
||||
"params": [],
|
||||
"params": [
|
||||
{
|
||||
"name": "no_cache",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"default": false,
|
||||
"desc": "是否强制刷新;QQ 当前仅暴露本地快照,true 会明确失败"
|
||||
}
|
||||
],
|
||||
"invariants": [],
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"properties": {
|
||||
"no_cache": {
|
||||
"type": "boolean",
|
||||
"description": "是否强制刷新;QQ 当前仅暴露本地快照,true 会明确失败",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
},
|
||||
"category": "扩展"
|
||||
|
||||
Reference in new issue
Block a user