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

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:
2026-07-05 09:36:54 +00:00
parent 3216769225
commit bedb527145
21108 changed files with 6010766 additions and 0 deletions

View File

@@ -0,0 +1,157 @@
import Foundation
enum ToolResultTextFormatter {
static func format(text: String, toolName: String?) -> String {
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else { return "" }
guard self.looksLikeJSON(trimmed),
let data = trimmed.data(using: .utf8),
let json = try? JSONSerialization.jsonObject(with: data)
else {
return trimmed
}
let normalizedTool = toolName?.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
return self.renderJSON(json, toolName: normalizedTool)
}
private static func looksLikeJSON(_ value: String) -> Bool {
guard let first = value.first else { return false }
return first == "{" || first == "["
}
private static func renderJSON(_ json: Any, toolName: String?) -> String {
if let dict = json as? [String: Any] {
return self.renderDictionary(dict, toolName: toolName)
}
if let array = json as? [Any] {
if array.isEmpty { return "No items." }
return "\(array.count) item\(array.count == 1 ? "" : "s")."
}
return ""
}
private static func renderDictionary(_ dict: [String: Any], toolName: String?) -> String {
let status = (dict["status"] as? String)?.trimmingCharacters(in: .whitespacesAndNewlines)
let errorText = self.firstString(in: dict, keys: ["error", "reason"])
let messageText = self.firstString(in: dict, keys: ["message", "result", "detail"])
if status?.lowercased() == "error" || errorText != nil {
if let errorText {
return "Error: \(self.sanitizeError(errorText))"
}
if let messageText {
return "Error: \(self.sanitizeError(messageText))"
}
return "Error"
}
if toolName == "nodes", let summary = self.renderNodesSummary(dict) {
return summary
}
if let message = messageText {
return message
}
if let status, !status.isEmpty {
return "Status: \(status)"
}
return ""
}
private static func renderNodesSummary(_ dict: [String: Any]) -> String? {
if let nodes = dict["nodes"] as? [[String: Any]] {
if nodes.isEmpty { return "No nodes found." }
var lines: [String] = []
lines.append("\(nodes.count) node\(nodes.count == 1 ? "" : "s") found.")
for node in nodes.prefix(3) {
let label = self.firstString(in: node, keys: ["displayName", "name", "nodeId"]) ?? "Node"
var details: [String] = []
if let connected = node["connected"] as? Bool {
details.append(connected ? "connected" : "offline")
}
if let platform = self.firstString(in: node, keys: ["platform"]) {
details.append(platform)
}
if let version = self.firstString(in: node, keys: ["osVersion", "appVersion", "version"]) {
details.append(version)
}
if let pairing = self.pairingDetail(node) {
details.append(pairing)
}
if details.isEmpty {
lines.append("\(label)")
} else {
lines.append("\(label) - \(details.joined(separator: ", "))")
}
}
let extra = nodes.count - 3
if extra > 0 {
lines.append("... +\(extra) more")
}
return lines.joined(separator: "\n")
}
if let pending = dict["pending"] as? [Any], let paired = dict["paired"] as? [Any] {
return "Pairing requests: \(pending.count) pending, \(paired.count) paired."
}
if let pending = dict["pending"] as? [Any] {
if pending.isEmpty { return "No pending pairing requests." }
return "\(pending.count) pending pairing request\(pending.count == 1 ? "" : "s")."
}
return nil
}
private static func pairingDetail(_ node: [String: Any]) -> String? {
if let paired = node["paired"] as? Bool, !paired {
return "pairing required"
}
for key in ["status", "state", "deviceStatus"] {
if let raw = node[key] as? String, raw.lowercased().contains("pairing required") {
return "pairing required"
}
}
return nil
}
private static func firstString(in dict: [String: Any], keys: [String]) -> String? {
for key in keys {
if let value = dict[key] as? String {
let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
if !trimmed.isEmpty {
return trimmed
}
}
}
return nil
}
private static func sanitizeError(_ raw: String) -> String {
var cleaned = raw.trimmingCharacters(in: .whitespacesAndNewlines)
if cleaned.contains("agent="),
cleaned.contains("action="),
let marker = cleaned.range(of: ": ")
{
cleaned = String(cleaned[marker.upperBound...]).trimmingCharacters(in: .whitespacesAndNewlines)
}
if let firstLine = cleaned.split(separator: "\n").first {
cleaned = String(firstLine).trimmingCharacters(in: .whitespacesAndNewlines)
}
if cleaned.count > 220 {
cleaned = String(cleaned.prefix(217)) + "..."
}
return cleaned
}
}