Files
openclaw/apps/macos/Sources/OpenClaw/CrestodianSettings.swift
Peter Steinberger a789b92b39 fix(macos): harden fresh AI onboarding (#102637)
* fix(macos): bootstrap Codex before onboarding test

* fix(plugins): activate deferred runtimes on demand

* fix(macos): stage Codex runtime for onboarding probe

* fix(macos): expose sanitized onboarding errors

* fix(codex): reuse native CLI auth during onboarding

* fix(macos): hide Crestodian without inference

* fix(codex): honor explicit runtime policy during setup

* fix(onboarding): redact verification errors

* fix(macos): reset onboarding state with gateway route

* fix(onboarding): persist Codex plugin install metadata

* chore: refresh onboarding inventories

* fix(macos): restart AI setup after gateway change

* chore: refresh native onboarding inventory

* fix(onboarding): defer gateway restart until setup persists

* fix(macos): reset Crestodian on gateway changes

* chore(macos): refresh native i18n inventory

* fix(onboarding): harden inference setup state

* docs(skills): reuse pristine Parallels snapshots

* chore(macos): refresh onboarding i18n inventory

* fix(onboarding): prevent stale gateway and install state

* docs(skills): preserve saved Parallels sessions

* fix(macos): balance AI onboarding layout

* fix(parallels): parse npm workspace pack output

* chore(macos): refresh onboarding i18n inventory

* fix(parallels): bundle workspace runtime in package artifact

* fix(parallels): isolate canonical package helper

* fix(parallels): pack self-contained workspace artifact

* fix(packaging): exclude macOS app bundle

* fix(macos): restart inference checks after route changes

* docs(changelog): defer onboarding note to release

* fix(onboarding): enforce inference-first gateway setup
2026-07-10 04:59:15 +01:00

57 lines
1.9 KiB
Swift

import SwiftUI
enum CrestodianAvailability {
static func shouldShow(configuredModel: String?) -> Bool {
!(configuredModel?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ?? true)
}
}
/// Settings pane hosting the Crestodian setup/repair chat.
///
/// The parent settings view exposes this pane only after inference is configured.
struct CrestodianSettings: View {
let isActive: Bool
let onReplyReceived: () -> Void
@State private var chat = CrestodianOnboardingChatModel(
welcomeVariant: nil,
sessionPrefix: "mac-settings-crestodian")
var body: some View {
VStack(alignment: .leading, spacing: 20) {
SettingsPageHeader(
title: "Crestodian",
subtitle: "Your AI-powered setup helper. It can check status, fix config, " +
"switch models, and connect channels.")
SettingsCardGroup("Chat") {
CrestodianOnboardingChatView(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: CrestodianOnboardingChatModel,
onReplyReceived: @escaping () -> Void)
{
chat.onAgentHandoff = {
AppNavigationActions.openChat()
}
chat.onReplyReceived = onReplyReceived
}
}