mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
44 lines
956 B
Swift
44 lines
956 B
Swift
import Foundation
|
|
import BotKit
|
|
|
|
// Prefer the BotKit wrapper to keep gateway request payloads consistent.
|
|
typealias AnyCodable = BotKit.AnyCodable
|
|
typealias InstanceIdentity = BotKit.InstanceIdentity
|
|
|
|
extension AnyCodable {
|
|
var stringValue: String? {
|
|
self.value as? String
|
|
}
|
|
|
|
var boolValue: Bool? {
|
|
self.value as? Bool
|
|
}
|
|
|
|
var intValue: Int? {
|
|
self.value as? Int
|
|
}
|
|
|
|
var doubleValue: Double? {
|
|
self.value as? Double
|
|
}
|
|
|
|
var dictionaryValue: [String: AnyCodable]? {
|
|
self.value as? [String: AnyCodable]
|
|
}
|
|
|
|
var arrayValue: [AnyCodable]? {
|
|
self.value as? [AnyCodable]
|
|
}
|
|
|
|
var foundationValue: Any {
|
|
switch self.value {
|
|
case let dict as [String: AnyCodable]:
|
|
dict.mapValues { $0.foundationValue }
|
|
case let array as [AnyCodable]:
|
|
array.map(\.foundationValue)
|
|
default:
|
|
self.value
|
|
}
|
|
}
|
|
}
|