Files
openclaw/apps/macos/Sources/OpenClaw/SystemAgentSettings.swift
Peter Steinberger a6a0716486 feat(setup): rename Crestodian to OpenClaw system agent
User-facing name is now OpenClaw (the system speaks); internal code name is
system-agent. Gateway methods crestodian.* -> openclaw.chat/openclaw.setup.*,
agent tool -> openclaw, reserved agent ids openclaw + retired crestodian.
openclaw setup routes: onboarding flags -> onboard, -m/--yes -> system agent,
bare configured interactive -> OpenClaw chat, unconfigured -> onboarding.
Hidden crestodian CLI and /crestodian TUI aliases kept; docs moved to
docs/cli/openclaw.md with redirect stub. macOS/Android strings in lockstep.

Refs #107237
2026-07-14 11:03:02 -07:00

57 lines
1.9 KiB
Swift

import SwiftUI
enum SystemAgentAvailability {
static func shouldShow(configuredModel: String?) -> Bool {
!(configuredModel?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ?? true)
}
}
/// Settings pane hosting the OpenClaw setup/repair chat.
///
/// The parent settings view exposes this pane only after inference is configured.
struct SystemAgentSettings: View {
let isActive: Bool
let onReplyReceived: () -> Void
@State private var chat = SystemAgentOnboardingChatModel(
welcomeVariant: nil,
sessionPrefix: "mac-settings-openclaw")
var body: some View {
VStack(alignment: .leading, spacing: 20) {
SettingsPageHeader(
title: "OpenClaw",
subtitle: "Your AI-powered setup helper. It can check status, fix config, " +
"switch models, and connect channels.")
SettingsCardGroup("Chat") {
SystemAgentOnboardingChatView(model: self.chat)
.frame(maxWidth: .infinity, minHeight: 320, maxHeight: .infinity)
}
.frame(maxHeight: .infinity)
Text("Tip: try “status”, “doctor”, “set default model …”, or “connect telegram”.")
.font(.caption)
.foregroundStyle(.secondary)
}
.settingsDetailContent()
.task(id: self.isActive) {
guard self.isActive else { return }
Self.configureChatCallbacks(
for: self.chat,
onReplyReceived: self.onReplyReceived)
await self.chat.startIfNeeded()
}
}
@MainActor
static func configureChatCallbacks(
for chat: SystemAgentOnboardingChatModel,
onReplyReceived: @escaping () -> Void)
{
chat.onAgentHandoff = {
AppNavigationActions.openChat()
}
chat.onReplyReceived = onReplyReceived
}
}