系统接口
系统接口可在匿名 Command WS 连接上调用。
system.ping
心跳探测。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 无 | - | - | params 可为空对象。 |
响应 data:
| 字段 | 类型 | 说明 |
|---|---|---|
pong | boolean | 固定为 true。 |
system.info
返回运行时状态快照。字段由当前 Runtime 的 status_supplier 提供。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 无 | - | - | params 可为空对象。 |
响应 data:
| 字段 | 类型 | 说明 |
|---|---|---|
running | boolean | Runtime 是否正在运行。 |
uptimeSec | number | Runtime 启动后的运行秒数。 |
bindHost | string | 本地服务监听地址。 |
process | object | 进程信息,包含 pid、executablePath。 |
http | object | HTTP 服务状态,包含 enabled、sites、assetBaseUrl。 |
ports | object | 本地端口,包含 adminHttp、demoHttp、assetHttp、commandWs、videoWs。 |
providers | object | 当前 provider 名称,包含 device、graphic、imageEnhance、ocr、ofd、auth。 |
authDiagnostics | object | 授权相关环境配置诊断。 |
ws | object | Command WS 和 Video WS 连接、鉴权失败、请求或帧统计。 |
application | object | 应用会话状态,包含 boundSessions、activeStreams。 |
system.capabilities
返回认证模型、公开方法和平台能力。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 无 | - | - | params 可为空对象。 |
响应 data:
| 字段 | 类型 | 说明 |
|---|---|---|
auth_model.connection_requires_token | boolean | Command WS 握手是否需要 token,当前为 false。 |
auth_model.session_field | string | 会话字段,当前为 session_token。 |
auth_model.session_binding | string | 当前为 connection_bound。 |
auth_model.video_binding | string | 当前为 session_token + stream_id。 |
methods[] | array | 方法清单,每项包含 method、requires_session、summary。 |
platform_capabilities.sane | object | SANE 支持平台和 provider 信息。 |
platform_capabilities.sane.supported_platforms | string[] | SANE 当前支持平台,值为 ["linux"]。 |
platform_capabilities.sane.linux_only | boolean | 当前为 true。 |
platform_capabilities.sane.provider | string | 当前 SANE provider 名称;未配置时为空字符串。 |
示例:
json
{
"request_id": "req-cap-001",
"method": "system.capabilities",
"params": {}
}