Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
378
apps/ios/Sources/Design/AgentProModels.swift
Normal file
378
apps/ios/Sources/Design/AgentProModels.swift
Normal file
@@ -0,0 +1,378 @@
|
||||
import Foundation
|
||||
import OpenClawKit
|
||||
import OpenClawProtocol
|
||||
|
||||
enum AgentProValueReader {
|
||||
static func intValue(_ value: AnyCodable?) -> Int? {
|
||||
switch value?.value {
|
||||
case let int as Int: int
|
||||
case let double as Double where double.isFinite: Int(double)
|
||||
case let string as String: Int(string)
|
||||
default: nil
|
||||
}
|
||||
}
|
||||
|
||||
static func doubleValue(_ value: AnyCodable?) -> Double? {
|
||||
switch value?.value {
|
||||
case let double as Double where double.isFinite: double
|
||||
case let int as Int: Double(int)
|
||||
case let string as String: Double(string)
|
||||
default: nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AgentOverviewSnapshot {
|
||||
let skills: SkillStatusReportLite?
|
||||
let presence: [PresenceEntry]
|
||||
let cronStatus: CronStatusLite?
|
||||
let cronJobs: [CronJob]
|
||||
let dreaming: DreamingStatusLite?
|
||||
let dreamDiary: DreamDiaryLite?
|
||||
let usage: CostUsageSummaryLite?
|
||||
let activeAgentId: String
|
||||
let agentSkillFilter: [String]?
|
||||
let loadedAt: Date
|
||||
|
||||
var hasAnyLiveData: Bool {
|
||||
self.skills != nil
|
||||
|| !self.presence.isEmpty
|
||||
|| self.cronStatus != nil
|
||||
|| !self.cronJobs.isEmpty
|
||||
|| self.dreaming != nil
|
||||
|| self.dreamDiary != nil
|
||||
|| self.usage != nil
|
||||
}
|
||||
}
|
||||
|
||||
struct SkillStatusReportLite: Decodable {
|
||||
let workspaceDir: String?
|
||||
let managedSkillsDir: String?
|
||||
let agentId: String?
|
||||
let agentSkillFilter: [String]?
|
||||
let skills: [SkillStatusEntryLite]
|
||||
|
||||
var totalCount: Int {
|
||||
self.skills.count
|
||||
}
|
||||
|
||||
var enabledCount: Int {
|
||||
self.skills.count {
|
||||
$0.isEnabled
|
||||
}
|
||||
}
|
||||
|
||||
var blockedCount: Int {
|
||||
self.skills.count {
|
||||
$0.blockedByAllowlist == true || $0.blockedByAgentFilter == true
|
||||
}
|
||||
}
|
||||
|
||||
var missingRequirementCount: Int {
|
||||
self.skills.count {
|
||||
$0.hasMissingRequirements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SkillStatusEntryLite: Decodable {
|
||||
let name: String
|
||||
let description: String?
|
||||
let source: String?
|
||||
let filePath: String?
|
||||
let skillKey: String?
|
||||
let primaryEnv: String?
|
||||
let emoji: String?
|
||||
let homepage: String?
|
||||
let disabled: Bool?
|
||||
let blockedByAllowlist: Bool?
|
||||
let blockedByAgentFilter: Bool?
|
||||
let missing: SkillStatusMissingLite?
|
||||
let install: [SkillInstallOptionLite]?
|
||||
|
||||
var displayName: String {
|
||||
if let emoji, !emoji.isEmpty {
|
||||
return "\(emoji) \(self.name)"
|
||||
}
|
||||
return self.name
|
||||
}
|
||||
|
||||
var effectiveSkillKey: String {
|
||||
let trimmed = (self.skillKey ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
return trimmed.isEmpty ? self.name : trimmed
|
||||
}
|
||||
|
||||
var isGloballyEnabled: Bool {
|
||||
self.disabled != true
|
||||
}
|
||||
|
||||
var isEnabled: Bool {
|
||||
self.disabled != true
|
||||
&& self.blockedByAllowlist != true
|
||||
&& self.blockedByAgentFilter != true
|
||||
}
|
||||
|
||||
var hasMissingRequirements: Bool {
|
||||
guard let missing else { return false }
|
||||
return !missing.bins.isEmpty
|
||||
|| !missing.env.isEmpty
|
||||
|| !missing.config.isEmpty
|
||||
|| !missing.os.isEmpty
|
||||
}
|
||||
|
||||
var missingSummary: String? {
|
||||
guard let missing else { return nil }
|
||||
let values = [
|
||||
missing.bins,
|
||||
missing.env,
|
||||
missing.config,
|
||||
missing.os,
|
||||
].flatMap(\.self)
|
||||
return values.isEmpty ? nil : values.prefix(3).joined(separator: ", ")
|
||||
}
|
||||
|
||||
var installSummary: String? {
|
||||
guard let option = self.install?.first else { return nil }
|
||||
return option.label
|
||||
}
|
||||
|
||||
var missingBins: [String] {
|
||||
self.missing?.bins ?? []
|
||||
}
|
||||
|
||||
var homepageURL: URL? {
|
||||
guard let homepage else { return nil }
|
||||
return URL(string: homepage)
|
||||
}
|
||||
}
|
||||
|
||||
struct SkillInstallOptionLite: Decodable {
|
||||
let id: String?
|
||||
let kind: String?
|
||||
let label: String
|
||||
let bins: [String]?
|
||||
}
|
||||
|
||||
struct SkillUpdateParams: Encodable {
|
||||
let skillKey: String
|
||||
var enabled: Bool?
|
||||
var apiKey: String?
|
||||
}
|
||||
|
||||
struct SkillInstallParams: Encodable {
|
||||
let name: String
|
||||
let installId: String
|
||||
let timeoutMs: Int
|
||||
}
|
||||
|
||||
struct SkillInstallResultLite: Decodable {
|
||||
let message: String?
|
||||
}
|
||||
|
||||
struct ClawHubSearchParams: Encodable {
|
||||
let query: String?
|
||||
let limit: Int
|
||||
}
|
||||
|
||||
struct ClawHubSearchResponseLite: Decodable {
|
||||
let results: [ClawHubSearchResultLite]
|
||||
}
|
||||
|
||||
struct ClawHubSearchResultLite: Decodable {
|
||||
let slug: String
|
||||
let displayName: String
|
||||
let summary: String?
|
||||
let version: String?
|
||||
}
|
||||
|
||||
struct ClawHubInstallParams: Encodable {
|
||||
let source = "clawhub"
|
||||
let slug: String
|
||||
}
|
||||
|
||||
struct CronRunParams: Encodable {
|
||||
let id: String
|
||||
let mode: String
|
||||
}
|
||||
|
||||
struct CronUpdatePatch: Encodable {
|
||||
let enabled: Bool
|
||||
}
|
||||
|
||||
struct CronUpdateParams: Encodable {
|
||||
let id: String
|
||||
let patch: CronUpdatePatch
|
||||
}
|
||||
|
||||
struct SkillStatusMissingLite: Decodable {
|
||||
let bins: [String]
|
||||
let env: [String]
|
||||
let config: [String]
|
||||
let os: [String]
|
||||
}
|
||||
|
||||
struct CronStatusLite: Decodable {
|
||||
let enabled: Bool
|
||||
let jobs: Int
|
||||
let nextwakeatms: Int?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case enabled
|
||||
case jobs
|
||||
case nextwakeatms = "nextWakeAtMs"
|
||||
}
|
||||
}
|
||||
|
||||
struct CronJobsListLite: Decodable {
|
||||
let jobs: [CronJob]
|
||||
let total: Int?
|
||||
}
|
||||
|
||||
struct DreamingStatusEnvelope: Decodable {
|
||||
let dreaming: DreamingStatusLite?
|
||||
}
|
||||
|
||||
struct DreamingStatusLite: Decodable {
|
||||
let enabled: Bool
|
||||
let shortTermCount: Int?
|
||||
let totalSignalCount: Int?
|
||||
let promotedToday: Int?
|
||||
let storeError: String?
|
||||
let shortTermEntries: [DreamingEntryLite]?
|
||||
let signalEntries: [DreamingEntryLite]?
|
||||
let promotedEntries: [DreamingEntryLite]?
|
||||
let phases: [String: DreamingPhaseStatusLite]?
|
||||
|
||||
var nextRunAtMs: Int? {
|
||||
self.phases?.values
|
||||
.compactMap(\.nextRunAtMs)
|
||||
.min()
|
||||
}
|
||||
}
|
||||
|
||||
struct DreamingEntryLite: Decodable, Identifiable {
|
||||
let key: String
|
||||
let path: String
|
||||
let startLine: Int
|
||||
let endLine: Int
|
||||
let snippet: String
|
||||
let recallCount: Int
|
||||
let dailyCount: Int
|
||||
let groundedCount: Int
|
||||
let totalSignalCount: Int
|
||||
let lightHits: Int
|
||||
let remHits: Int
|
||||
let phaseHitCount: Int
|
||||
let promotedAt: String?
|
||||
let lastRecalledAt: String?
|
||||
|
||||
var id: String {
|
||||
"\(self.key):\(self.path):\(self.startLine):\(self.endLine)"
|
||||
}
|
||||
}
|
||||
|
||||
struct DreamDiaryLite: Decodable {
|
||||
let agentId: String
|
||||
let found: Bool
|
||||
let path: String
|
||||
let content: String?
|
||||
let updatedAtMs: Int?
|
||||
}
|
||||
|
||||
struct DreamingPhaseStatusLite: Decodable {
|
||||
let enabled: Bool?
|
||||
let cron: String?
|
||||
let managedCronPresent: Bool?
|
||||
let nextRunAtMs: Int?
|
||||
}
|
||||
|
||||
struct DreamingPhaseRow: Identifiable {
|
||||
let id: String
|
||||
let title: String
|
||||
let status: DreamingPhaseStatusLite
|
||||
}
|
||||
|
||||
struct ConfigSnapshotLite: Decodable {
|
||||
let hash: String?
|
||||
let config: ConfigRootLite?
|
||||
|
||||
func agentConfig(id: String) -> AgentConfigLite? {
|
||||
self.config?.agents?.list?.first { $0.id == id }
|
||||
}
|
||||
|
||||
func effectiveSkillFilter(agentId: String) -> [String]? {
|
||||
if let agentSkills = self.agentConfig(id: agentId)?.skills {
|
||||
return agentSkills
|
||||
}
|
||||
return self.config?.agents?.defaults?.skills
|
||||
}
|
||||
}
|
||||
|
||||
struct ConfigRootLite: Decodable {
|
||||
let agents: AgentsConfigLite?
|
||||
}
|
||||
|
||||
struct AgentsConfigLite: Decodable {
|
||||
let defaults: AgentDefaultsConfigLite?
|
||||
let list: [AgentConfigLite]?
|
||||
}
|
||||
|
||||
struct AgentDefaultsConfigLite: Decodable {
|
||||
let skills: [String]?
|
||||
}
|
||||
|
||||
struct AgentConfigLite: Decodable {
|
||||
let id: String
|
||||
let skills: [String]?
|
||||
}
|
||||
|
||||
struct ConfigPatchParams: Encodable {
|
||||
let raw: String
|
||||
let baseHash: String
|
||||
let replacePaths: [String]?
|
||||
|
||||
init(raw: String, baseHash: String, replacePaths: [String]? = nil) {
|
||||
self.raw = raw
|
||||
self.baseHash = baseHash
|
||||
self.replacePaths = replacePaths
|
||||
}
|
||||
}
|
||||
|
||||
enum SkillMutationError: LocalizedError {
|
||||
case liveGatewayUnavailable
|
||||
case missingConfigHash
|
||||
case invalidPatchPayload
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .liveGatewayUnavailable:
|
||||
"Connect a live gateway to edit agent skills."
|
||||
case .missingConfigHash:
|
||||
"Config hash missing; refresh and retry."
|
||||
case .invalidPatchPayload:
|
||||
"Could not encode the skill config update."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct CostUsageSummaryLite: Decodable {
|
||||
let updatedAt: Int?
|
||||
let days: Int?
|
||||
let daily: [CostUsageDailyEntryLite]?
|
||||
let totals: [String: AnyCodable]?
|
||||
let cacheStatus: [String: AnyCodable]?
|
||||
|
||||
var totalCost: Double? {
|
||||
AgentProValueReader.doubleValue(self.totals?["totalCost"])
|
||||
}
|
||||
|
||||
var totalTokens: Int? {
|
||||
AgentProValueReader.intValue(self.totals?["totalTokens"])
|
||||
}
|
||||
}
|
||||
|
||||
struct CostUsageDailyEntryLite: Decodable {
|
||||
let date: String
|
||||
let totalTokens: Int?
|
||||
let totalCost: Double?
|
||||
}
|
||||
Reference in New Issue
Block a user