RPC 和 API

设备型号数据库

macOS 配套应用会在 实例 界面中显示友好的苹果设备型号名称,这是通过将苹果型号标识符(如 iPad16,6Mac16,6)映射为人类可读名称实现的。映射数据以 JSON 形式内置在:

  • apps/macos/Sources/OpenClaw/Resources/DeviceModels/

数据来源

我们目前使用以下 MIT 许可证仓库的映射数据:

  • kyle-seongwoo-jun/apple-device-identifiers

为确保构建的可重复性,JSON 文件被固定到特定的上游提交(记录在 apps/macos/Sources/OpenClaw/Resources/DeviceModels/NOTICE.md 中)。

如何更新数据库

  1. 选择你要固定的上游提交(一个用于 iOS,一个用于 macOS)。
  2. 更新 apps/macos/Sources/OpenClaw/Resources/DeviceModels/NOTICE.md 中的提交哈希值。
  3. 重新下载 JSON 文件,固定到这些提交:
IOS_COMMIT="<ios-device-identifiers.json 的提交 sha>"
MAC_COMMIT="<mac-device-identifiers.json 的提交 sha>"

curl -fsSL "https://raw.githubusercontent.com/kyle-seongwoo-jun/apple-device-identifiers/${IOS_COMMIT}/ios-device-identifiers.json" \
  -o apps/macos/Sources/OpenClaw/Resources/DeviceModels/ios-device-identifiers.json

curl -fsSL "https://raw.githubusercontent.com/kyle-seongwoo-jun/apple-device-identifiers/${MAC_COMMIT}/mac-device-identifiers.json" \
  -o apps/macos/Sources/OpenClaw/Resources/DeviceModels/mac-device-identifiers.json
  1. 确保 apps/macos/Sources/OpenClaw/Resources/DeviceModels/LICENSE.apple-device-identifiers.txt 仍与上游一致(如果上游许可证有变化,请替换它)。
  2. 验证 macOS 应用可以正常构建(无警告):
swift build --package-path apps/macos

RPC 适配器默认 AGENTS.md