mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
76cb418b6f
* fix(macos): let onboarding replace an auto-connected AI The AI page auto-tests the best detected candidate and connects without asking, then hides every alternative route. Add 'Choose a different AI' to the connected banner: a re-detect pass with auto-activation suppressed that ends at the picker (candidates, provider sign-in, API keys). Also disable the manual key Connect button while another test runs (submitManualKey silently dropped the tap), and isolate a test that read the machine's real resume store. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(macos): surface real daemon errors past the Node banner Gateway daemon failures summarized as 'Node.js v26.5.1' because the summary takes the last non-empty line and Node fatal errors end with a version banner. Drop trailing banner lines and prefer the last error-shaped line above them; all other output keeps its last line. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(macos): hand onboarding off to the dashboard custodian Native onboarding now ends once inference verifies: welcome, connection, install (when needed), AI setup. Finish opens the dashboard at /custodian?onboarding=1, where the custodian onboarding owns memory import, channels, app recommendations, and the hatch (browser-first per the onboarding redesign). The native memory-import and permissions pages leave the first-run flow; 'Set up later' keeps the native ready page. The native navigation bridge gains a validated optional search field so the handoff can request onboarding chrome; the URL fallback carries the query alongside the token fragment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(macos): delete the unreachable native memory-import module The dashboard handoff removed the memory-import page from every flow, leaving the module reachable only from tests. CI's dead-code scan rightly flagged the first orphans; remove the whole path (model, page, mascot wiring, tests) instead of trimming symbol by symbol. The dashboard's own memory-import surface owns the feature. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
38 lines
1.6 KiB
Swift
38 lines
1.6 KiB
Swift
import Foundation
|
|
|
|
enum TextSummarySupport {
|
|
static func summarizeLastLine(_ text: String, maxLength: Int = 200) -> String? {
|
|
let lines = text
|
|
.split(whereSeparator: \.isNewline)
|
|
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
|
|
.filter { !$0.isEmpty }
|
|
guard !lines.isEmpty else { return nil }
|
|
// Node fatal errors end with a bare "Node.js vX.Y.Z" banner. Surfacing
|
|
// that line hides the actual failure ("Error: Cannot find module …"),
|
|
// so drop the banner and prefer the last real error line above it.
|
|
var candidates = lines[...]
|
|
var droppedNodeBanner = false
|
|
while let last = candidates.last, Self.isNodeVersionBanner(last) {
|
|
candidates = candidates.dropLast()
|
|
droppedNodeBanner = true
|
|
}
|
|
var chosen = candidates.last ?? lines[lines.count - 1]
|
|
if droppedNodeBanner, let errorLine = candidates.suffix(40).last(where: self.isErrorLine) {
|
|
chosen = errorLine
|
|
}
|
|
let normalized = chosen.replacingOccurrences(of: "\\s+", with: " ", options: .regularExpression)
|
|
if normalized.count > maxLength {
|
|
return String(normalized.prefix(maxLength - 1)) + "…"
|
|
}
|
|
return normalized
|
|
}
|
|
|
|
private static func isNodeVersionBanner(_ line: String) -> Bool {
|
|
line.range(of: #"^Node\.js v\d"#, options: .regularExpression) != nil
|
|
}
|
|
|
|
private static func isErrorLine(_ line: String) -> Bool {
|
|
line.range(of: #"^\w*Error(\b|:)"#, options: .regularExpression) != nil
|
|
}
|
|
}
|