mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 11:02:12 +03:00
style(swift): run swiftformat + swiftlint autocorrect
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
// Human-friendly age string (e.g., "2m ago").
|
/// Human-friendly age string (e.g., "2m ago").
|
||||||
func age(from date: Date, now: Date = .init()) -> String {
|
func age(from date: Date, now: Date = .init()) -> String {
|
||||||
let seconds = max(0, Int(now.timeIntervalSince(date)))
|
let seconds = max(0, Int(now.timeIntervalSince(date)))
|
||||||
let minutes = seconds / 60
|
let minutes = seconds / 60
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ enum AgentWorkspace {
|
|||||||
]
|
]
|
||||||
enum BootstrapSafety: Equatable {
|
enum BootstrapSafety: Equatable {
|
||||||
case safe
|
case safe
|
||||||
case unsafe(reason: String)
|
case unsafe (reason: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func displayPath(for url: URL) -> String {
|
static func displayPath(for url: URL) -> String {
|
||||||
@@ -72,7 +72,7 @@ enum AgentWorkspace {
|
|||||||
return .safe
|
return .safe
|
||||||
}
|
}
|
||||||
if !isDir.boolValue {
|
if !isDir.boolValue {
|
||||||
return .unsafe(reason: "Workspace path points to a file.")
|
return .unsafe (reason: "Workspace path points to a file.")
|
||||||
}
|
}
|
||||||
let agentsURL = self.agentsURL(workspaceURL: workspaceURL)
|
let agentsURL = self.agentsURL(workspaceURL: workspaceURL)
|
||||||
if fm.fileExists(atPath: agentsURL.path) {
|
if fm.fileExists(atPath: agentsURL.path) {
|
||||||
@@ -82,9 +82,9 @@ enum AgentWorkspace {
|
|||||||
let entries = try self.workspaceEntries(workspaceURL: workspaceURL)
|
let entries = try self.workspaceEntries(workspaceURL: workspaceURL)
|
||||||
return entries.isEmpty
|
return entries.isEmpty
|
||||||
? .safe
|
? .safe
|
||||||
: .unsafe(reason: "Folder isn't empty. Choose a new folder or add AGENTS.md first.")
|
: .unsafe (reason: "Folder isn't empty. Choose a new folder or add AGENTS.md first.")
|
||||||
} catch {
|
} catch {
|
||||||
return .unsafe(reason: "Couldn't inspect the workspace folder.")
|
return .unsafe (reason: "Couldn't inspect the workspace folder.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -234,9 +234,8 @@ enum OpenClawOAuthStore {
|
|||||||
return URL(fileURLWithPath: expanded, isDirectory: true)
|
return URL(fileURLWithPath: expanded, isDirectory: true)
|
||||||
}
|
}
|
||||||
let home = FileManager().homeDirectoryForCurrentUser
|
let home = FileManager().homeDirectoryForCurrentUser
|
||||||
let preferred = home.appendingPathComponent(".openclaw", isDirectory: true)
|
return home.appendingPathComponent(".openclaw", isDirectory: true)
|
||||||
.appendingPathComponent("credentials", isDirectory: true)
|
.appendingPathComponent("credentials", isDirectory: true)
|
||||||
return preferred
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static func oauthURL() -> URL {
|
static func oauthURL() -> URL {
|
||||||
|
|||||||
@@ -1,18 +1,35 @@
|
|||||||
|
import Foundation
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import OpenClawProtocol
|
import OpenClawProtocol
|
||||||
import Foundation
|
|
||||||
|
|
||||||
// Prefer the OpenClawKit wrapper to keep gateway request payloads consistent.
|
// Prefer the OpenClawKit wrapper to keep gateway request payloads consistent.
|
||||||
typealias AnyCodable = OpenClawKit.AnyCodable
|
typealias AnyCodable = OpenClawKit.AnyCodable
|
||||||
typealias InstanceIdentity = OpenClawKit.InstanceIdentity
|
typealias InstanceIdentity = OpenClawKit.InstanceIdentity
|
||||||
|
|
||||||
extension AnyCodable {
|
extension AnyCodable {
|
||||||
var stringValue: String? { self.value as? String }
|
var stringValue: String? {
|
||||||
var boolValue: Bool? { self.value as? Bool }
|
self.value as? String
|
||||||
var intValue: Int? { self.value as? Int }
|
}
|
||||||
var doubleValue: Double? { self.value as? Double }
|
|
||||||
var dictionaryValue: [String: AnyCodable]? { self.value as? [String: AnyCodable] }
|
var boolValue: Bool? {
|
||||||
var arrayValue: [AnyCodable]? { self.value as? [AnyCodable] }
|
self.value as? Bool
|
||||||
|
}
|
||||||
|
|
||||||
|
var intValue: Int? {
|
||||||
|
self.value as? Int
|
||||||
|
}
|
||||||
|
|
||||||
|
var doubleValue: Double? {
|
||||||
|
self.value as? Double
|
||||||
|
}
|
||||||
|
|
||||||
|
var dictionaryValue: [String: AnyCodable]? {
|
||||||
|
self.value as? [String: AnyCodable]
|
||||||
|
}
|
||||||
|
|
||||||
|
var arrayValue: [AnyCodable]? {
|
||||||
|
self.value as? [AnyCodable]
|
||||||
|
}
|
||||||
|
|
||||||
var foundationValue: Any {
|
var foundationValue: Any {
|
||||||
switch self.value {
|
switch self.value {
|
||||||
@@ -27,12 +44,29 @@ extension AnyCodable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension OpenClawProtocol.AnyCodable {
|
extension OpenClawProtocol.AnyCodable {
|
||||||
var stringValue: String? { self.value as? String }
|
var stringValue: String? {
|
||||||
var boolValue: Bool? { self.value as? Bool }
|
self.value as? String
|
||||||
var intValue: Int? { self.value as? Int }
|
}
|
||||||
var doubleValue: Double? { self.value as? Double }
|
|
||||||
var dictionaryValue: [String: OpenClawProtocol.AnyCodable]? { self.value as? [String: OpenClawProtocol.AnyCodable] }
|
var boolValue: Bool? {
|
||||||
var arrayValue: [OpenClawProtocol.AnyCodable]? { self.value as? [OpenClawProtocol.AnyCodable] }
|
self.value as? Bool
|
||||||
|
}
|
||||||
|
|
||||||
|
var intValue: Int? {
|
||||||
|
self.value as? Int
|
||||||
|
}
|
||||||
|
|
||||||
|
var doubleValue: Double? {
|
||||||
|
self.value as? Double
|
||||||
|
}
|
||||||
|
|
||||||
|
var dictionaryValue: [String: OpenClawProtocol.AnyCodable]? {
|
||||||
|
self.value as? [String: OpenClawProtocol.AnyCodable]
|
||||||
|
}
|
||||||
|
|
||||||
|
var arrayValue: [OpenClawProtocol.AnyCodable]? {
|
||||||
|
self.value as? [OpenClawProtocol.AnyCodable]
|
||||||
|
}
|
||||||
|
|
||||||
var foundationValue: Any {
|
var foundationValue: Any {
|
||||||
switch self.value {
|
switch self.value {
|
||||||
|
|||||||
@@ -422,11 +422,10 @@ final class AppState {
|
|||||||
let trimmedUser = parsed.user?.trimmingCharacters(in: .whitespacesAndNewlines)
|
let trimmedUser = parsed.user?.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
let user = (trimmedUser?.isEmpty ?? true) ? nil : trimmedUser
|
let user = (trimmedUser?.isEmpty ?? true) ? nil : trimmedUser
|
||||||
let port = parsed.port
|
let port = parsed.port
|
||||||
let assembled: String
|
let assembled: String = if let user {
|
||||||
if let user {
|
port == 22 ? "\(user)@\(host)" : "\(user)@\(host):\(port)"
|
||||||
assembled = port == 22 ? "\(user)@\(host)" : "\(user)@\(host):\(port)"
|
|
||||||
} else {
|
} else {
|
||||||
assembled = port == 22 ? host : "\(host):\(port)"
|
port == 22 ? host : "\(host):\(port)"
|
||||||
}
|
}
|
||||||
if assembled != self.remoteTarget {
|
if assembled != self.remoteTarget {
|
||||||
self.remoteTarget = assembled
|
self.remoteTarget = assembled
|
||||||
@@ -698,7 +697,9 @@ extension AppState {
|
|||||||
@MainActor
|
@MainActor
|
||||||
enum AppStateStore {
|
enum AppStateStore {
|
||||||
static let shared = AppState()
|
static let shared = AppState()
|
||||||
static var isPausedFlag: Bool { UserDefaults.standard.bool(forKey: pauseDefaultsKey) }
|
static var isPausedFlag: Bool {
|
||||||
|
UserDefaults.standard.bool(forKey: pauseDefaultsKey)
|
||||||
|
}
|
||||||
|
|
||||||
static func updateLaunchAtLogin(enabled: Bool) {
|
static func updateLaunchAtLogin(enabled: Bool) {
|
||||||
Task.detached(priority: .utility) {
|
Task.detached(priority: .utility) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import AVFoundation
|
import AVFoundation
|
||||||
import OpenClawIPC
|
|
||||||
import OpenClawKit
|
|
||||||
import CoreGraphics
|
import CoreGraphics
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawIPC
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
actor CameraCaptureService {
|
actor CameraCaptureService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Foundation
|
|
||||||
import WebKit
|
import WebKit
|
||||||
|
|
||||||
final class CanvasA2UIActionMessageHandler: NSObject, WKScriptMessageHandler {
|
final class CanvasA2UIActionMessageHandler: NSObject, WKScriptMessageHandler {
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ final class HoverChromeContainerView: NSView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) is not supported") }
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) is not supported")
|
||||||
|
}
|
||||||
|
|
||||||
override func updateTrackingAreas() {
|
override func updateTrackingAreas() {
|
||||||
super.updateTrackingAreas()
|
super.updateTrackingAreas()
|
||||||
@@ -60,14 +62,18 @@ final class HoverChromeContainerView: NSView {
|
|||||||
self.window?.performDrag(with: event)
|
self.window?.performDrag(with: event)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func acceptsFirstMouse(for _: NSEvent?) -> Bool { true }
|
override func acceptsFirstMouse(for _: NSEvent?) -> Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class CanvasResizeHandleView: NSView {
|
private final class CanvasResizeHandleView: NSView {
|
||||||
private var startPoint: NSPoint = .zero
|
private var startPoint: NSPoint = .zero
|
||||||
private var startFrame: NSRect = .zero
|
private var startFrame: NSRect = .zero
|
||||||
|
|
||||||
override func acceptsFirstMouse(for _: NSEvent?) -> Bool { true }
|
override func acceptsFirstMouse(for _: NSEvent?) -> Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
override func mouseDown(with event: NSEvent) {
|
override func mouseDown(with event: NSEvent) {
|
||||||
guard let window else { return }
|
guard let window else { return }
|
||||||
@@ -102,7 +108,9 @@ final class HoverChromeContainerView: NSView {
|
|||||||
private let resizeHandle = CanvasResizeHandleView(frame: .zero)
|
private let resizeHandle = CanvasResizeHandleView(frame: .zero)
|
||||||
|
|
||||||
private final class PassthroughVisualEffectView: NSVisualEffectView {
|
private final class PassthroughVisualEffectView: NSVisualEffectView {
|
||||||
override func hitTest(_: NSPoint) -> NSView? { nil }
|
override func hitTest(_: NSPoint) -> NSView? {
|
||||||
|
nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private let closeBackground: NSVisualEffectView = {
|
private let closeBackground: NSVisualEffectView = {
|
||||||
@@ -190,7 +198,9 @@ final class HoverChromeContainerView: NSView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) is not supported") }
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) is not supported")
|
||||||
|
}
|
||||||
|
|
||||||
override func hitTest(_ point: NSPoint) -> NSView? {
|
override func hitTest(_ point: NSPoint) -> NSView? {
|
||||||
// When the chrome is hidden, do not intercept any mouse events (let the WKWebView receive them).
|
// When the chrome is hidden, do not intercept any mouse events (let the WKWebView receive them).
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Foundation
|
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
import WebKit
|
import WebKit
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,13 @@ enum CanvasLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final class CanvasPanel: NSPanel {
|
final class CanvasPanel: NSPanel {
|
||||||
override var canBecomeKey: Bool { true }
|
override var canBecomeKey: Bool {
|
||||||
override var canBecomeMain: Bool { true }
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
override var canBecomeMain: Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CanvasPresentation {
|
enum CanvasPresentation {
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ extension CanvasWindowController {
|
|||||||
// Deep links: allow local Canvas content to invoke the agent without bouncing through NSWorkspace.
|
// Deep links: allow local Canvas content to invoke the agent without bouncing through NSWorkspace.
|
||||||
if scheme == "openclaw" {
|
if scheme == "openclaw" {
|
||||||
if let currentScheme = self.webView.url?.scheme,
|
if let currentScheme = self.webView.url?.scheme,
|
||||||
CanvasScheme.allSchemes.contains(currentScheme) {
|
CanvasScheme.allSchemes.contains(currentScheme)
|
||||||
|
{
|
||||||
Task { await DeepLinkHandler.shared.handle(url: url) }
|
Task { await DeepLinkHandler.shared.handle(url: url) }
|
||||||
} else {
|
} else {
|
||||||
canvasWindowLogger
|
canvasWindowLogger
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Foundation
|
|
||||||
import WebKit
|
import WebKit
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@@ -183,7 +183,9 @@ final class CanvasWindowController: NSWindowController, WKNavigationDelegate, NS
|
|||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) is not supported") }
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) is not supported")
|
||||||
|
}
|
||||||
|
|
||||||
@MainActor deinit {
|
@MainActor deinit {
|
||||||
for name in CanvasA2UIActionMessageHandler.allMessageNames {
|
for name in CanvasA2UIActionMessageHandler.allMessageNames {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ extension ChannelsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
func channelHeaderActions(_ channel: ChannelItem) -> some View {
|
func channelHeaderActions(_ channel: ChannelItem) -> some View {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
if channel.id == "whatsapp" {
|
if channel.id == "whatsapp" {
|
||||||
@@ -88,7 +87,6 @@ extension ChannelsSettings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
func genericChannelSection(_ channel: ChannelItem) -> some View {
|
func genericChannelSection(_ channel: ChannelItem) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 16) {
|
VStack(alignment: .leading, spacing: 16) {
|
||||||
self.configEditorSection(channelId: channel.id)
|
self.configEditorSection(channelId: channel.id)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
extension ChannelsStore {
|
extension ChannelsStore {
|
||||||
func loadConfigSchema() async {
|
func loadConfigSchema() async {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
extension ChannelsStore {
|
extension ChannelsStore {
|
||||||
func start() {
|
func start() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
struct ChannelsStatusSnapshot: Codable {
|
struct ChannelsStatusSnapshot: Codable {
|
||||||
struct WhatsAppSelf: Codable {
|
struct WhatsAppSelf: Codable {
|
||||||
|
|||||||
@@ -39,11 +39,26 @@ struct ConfigSchemaNode {
|
|||||||
self.raw = dict
|
self.raw = dict
|
||||||
}
|
}
|
||||||
|
|
||||||
var title: String? { self.raw["title"] as? String }
|
var title: String? {
|
||||||
var description: String? { self.raw["description"] as? String }
|
self.raw["title"] as? String
|
||||||
var enumValues: [Any]? { self.raw["enum"] as? [Any] }
|
}
|
||||||
var constValue: Any? { self.raw["const"] }
|
|
||||||
var explicitDefault: Any? { self.raw["default"] }
|
var description: String? {
|
||||||
|
self.raw["description"] as? String
|
||||||
|
}
|
||||||
|
|
||||||
|
var enumValues: [Any]? {
|
||||||
|
self.raw["enum"] as? [Any]
|
||||||
|
}
|
||||||
|
|
||||||
|
var constValue: Any? {
|
||||||
|
self.raw["const"]
|
||||||
|
}
|
||||||
|
|
||||||
|
var explicitDefault: Any? {
|
||||||
|
self.raw["default"]
|
||||||
|
}
|
||||||
|
|
||||||
var requiredKeys: Set<String> {
|
var requiredKeys: Set<String> {
|
||||||
Set((self.raw["required"] as? [String]) ?? [])
|
Set((self.raw["required"] as? [String]) ?? [])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ extension ConfigSettings {
|
|||||||
let help: String?
|
let help: String?
|
||||||
let node: ConfigSchemaNode
|
let node: ConfigSchemaNode
|
||||||
|
|
||||||
var id: String { self.key }
|
var id: String {
|
||||||
|
self.key
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct ConfigSubsection: Identifiable {
|
private struct ConfigSubsection: Identifiable {
|
||||||
@@ -55,7 +57,9 @@ extension ConfigSettings {
|
|||||||
let node: ConfigSchemaNode
|
let node: ConfigSchemaNode
|
||||||
let path: ConfigPath
|
let path: ConfigPath
|
||||||
|
|
||||||
var id: String { self.key }
|
var id: String {
|
||||||
|
self.key
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var sections: [ConfigSection] {
|
private var sections: [ConfigSection] {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
enum ConfigStore {
|
enum ConfigStore {
|
||||||
struct Overrides: Sendable {
|
struct Overrides: Sendable {
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ struct ContextMenuCardView: View {
|
|||||||
return "\(count) sessions · 24h"
|
return "\(count) sessions · 24h"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func sessionRow(_ row: SessionRow) -> some View {
|
private func sessionRow(_ row: SessionRow) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 5) {
|
VStack(alignment: .leading, spacing: 5) {
|
||||||
ContextUsageBar(
|
ContextUsageBar(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct ControlHeartbeatEvent: Codable {
|
struct ControlHeartbeatEvent: Codable {
|
||||||
@@ -15,7 +15,10 @@ struct ControlHeartbeatEvent: Codable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ControlAgentEvent: Codable, Sendable, Identifiable {
|
struct ControlAgentEvent: Codable, Sendable, Identifiable {
|
||||||
var id: String { "\(self.runId)-\(self.seq)" }
|
var id: String {
|
||||||
|
"\(self.runId)-\(self.seq)"
|
||||||
|
}
|
||||||
|
|
||||||
let runId: String
|
let runId: String
|
||||||
let seq: Int
|
let seq: Int
|
||||||
let stream: String
|
let stream: String
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
extension CronJobEditor {
|
extension CronJobEditor {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct CronJobEditor: View {
|
struct CronJobEditor: View {
|
||||||
@@ -32,18 +32,24 @@ struct CronJobEditor: View {
|
|||||||
@State var wakeMode: CronWakeMode = .now
|
@State var wakeMode: CronWakeMode = .now
|
||||||
@State var deleteAfterRun: Bool = false
|
@State var deleteAfterRun: Bool = false
|
||||||
|
|
||||||
enum ScheduleKind: String, CaseIterable, Identifiable { case at, every, cron; var id: String { rawValue } }
|
enum ScheduleKind: String, CaseIterable, Identifiable { case at, every, cron; var id: String {
|
||||||
|
rawValue
|
||||||
|
} }
|
||||||
@State var scheduleKind: ScheduleKind = .every
|
@State var scheduleKind: ScheduleKind = .every
|
||||||
@State var atDate: Date = .init().addingTimeInterval(60 * 5)
|
@State var atDate: Date = .init().addingTimeInterval(60 * 5)
|
||||||
@State var everyText: String = "1h"
|
@State var everyText: String = "1h"
|
||||||
@State var cronExpr: String = "0 9 * * 3"
|
@State var cronExpr: String = "0 9 * * 3"
|
||||||
@State var cronTz: String = ""
|
@State var cronTz: String = ""
|
||||||
|
|
||||||
enum PayloadKind: String, CaseIterable, Identifiable { case systemEvent, agentTurn; var id: String { rawValue } }
|
enum PayloadKind: String, CaseIterable, Identifiable { case systemEvent, agentTurn; var id: String {
|
||||||
|
rawValue
|
||||||
|
} }
|
||||||
@State var payloadKind: PayloadKind = .systemEvent
|
@State var payloadKind: PayloadKind = .systemEvent
|
||||||
@State var systemEventText: String = ""
|
@State var systemEventText: String = ""
|
||||||
@State var agentMessage: String = ""
|
@State var agentMessage: String = ""
|
||||||
enum DeliveryChoice: String, CaseIterable, Identifiable { case announce, none; var id: String { rawValue } }
|
enum DeliveryChoice: String, CaseIterable, Identifiable { case announce, none; var id: String {
|
||||||
|
rawValue
|
||||||
|
} }
|
||||||
@State var deliveryMode: DeliveryChoice = .announce
|
@State var deliveryMode: DeliveryChoice = .announce
|
||||||
@State var channel: String = "last"
|
@State var channel: String = "last"
|
||||||
@State var to: String = ""
|
@State var to: String = ""
|
||||||
@@ -244,7 +250,6 @@ struct CronJobEditor: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(.vertical, 2)
|
.padding(.vertical, 2)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -4,21 +4,27 @@ enum CronSessionTarget: String, CaseIterable, Identifiable, Codable {
|
|||||||
case main
|
case main
|
||||||
case isolated
|
case isolated
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CronWakeMode: String, CaseIterable, Identifiable, Codable {
|
enum CronWakeMode: String, CaseIterable, Identifiable, Codable {
|
||||||
case now
|
case now
|
||||||
case nextHeartbeat = "next-heartbeat"
|
case nextHeartbeat = "next-heartbeat"
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CronDeliveryMode: String, CaseIterable, Identifiable, Codable {
|
enum CronDeliveryMode: String, CaseIterable, Identifiable, Codable {
|
||||||
case none
|
case none
|
||||||
case announce
|
case announce
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CronDelivery: Codable, Equatable {
|
struct CronDelivery: Codable, Equatable {
|
||||||
@@ -98,11 +104,11 @@ enum CronSchedule: Codable, Equatable {
|
|||||||
let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
|
let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
if trimmed.isEmpty { return nil }
|
if trimmed.isEmpty { return nil }
|
||||||
if let date = makeIsoFormatter(withFractional: true).date(from: trimmed) { return date }
|
if let date = makeIsoFormatter(withFractional: true).date(from: trimmed) { return date }
|
||||||
return makeIsoFormatter(withFractional: false).date(from: trimmed)
|
return self.makeIsoFormatter(withFractional: false).date(from: trimmed)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func formatIsoDate(_ date: Date) -> String {
|
static func formatIsoDate(_ date: Date) -> String {
|
||||||
makeIsoFormatter(withFractional: false).string(from: date)
|
self.makeIsoFormatter(withFractional: false).string(from: date)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func makeIsoFormatter(withFractional: Bool) -> ISO8601DateFormatter {
|
private static func makeIsoFormatter(withFractional: Bool) -> ISO8601DateFormatter {
|
||||||
@@ -231,7 +237,9 @@ struct CronEvent: Codable, Sendable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct CronRunLogEntry: Codable, Identifiable, Sendable {
|
struct CronRunLogEntry: Codable, Identifiable, Sendable {
|
||||||
var id: String { "\(self.jobId)-\(self.ts)" }
|
var id: String {
|
||||||
|
"\(self.jobId)-\(self.ts)"
|
||||||
|
}
|
||||||
|
|
||||||
let ts: Int
|
let ts: Int
|
||||||
let jobId: String
|
let jobId: String
|
||||||
@@ -243,7 +251,10 @@ struct CronRunLogEntry: Codable, Identifiable, Sendable {
|
|||||||
let durationMs: Int?
|
let durationMs: Int?
|
||||||
let nextRunAtMs: Int?
|
let nextRunAtMs: Int?
|
||||||
|
|
||||||
var date: Date { Date(timeIntervalSince1970: TimeInterval(self.ts) / 1000) }
|
var date: Date {
|
||||||
|
Date(timeIntervalSince1970: TimeInterval(self.ts) / 1000)
|
||||||
|
}
|
||||||
|
|
||||||
var runDate: Date? {
|
var runDate: Date? {
|
||||||
guard let runAtMs else { return nil }
|
guard let runAtMs else { return nil }
|
||||||
return Date(timeIntervalSince1970: TimeInterval(runAtMs) / 1000)
|
return Date(timeIntervalSince1970: TimeInterval(runAtMs) / 1000)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
extension CronSettings {
|
extension CronSettings {
|
||||||
func save(payload: [String: AnyCodable]) async {
|
func save(payload: [String: AnyCodable]) async {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
import Security
|
import Security
|
||||||
|
|
||||||
private let deepLinkLogger = Logger(subsystem: "ai.openclaw", category: "DeepLink")
|
private let deepLinkLogger = Logger(subsystem: "ai.openclaw", category: "DeepLink")
|
||||||
|
|
||||||
enum DeepLinkAgentPolicy {
|
enum DeepLinkAgentPolicy {
|
||||||
static let maxMessageChars = 20_000
|
static let maxMessageChars = 20000
|
||||||
static let maxUnkeyedConfirmChars = 240
|
static let maxUnkeyedConfirmChars = 240
|
||||||
|
|
||||||
enum ValidationError: Error, Equatable, LocalizedError {
|
enum ValidationError: Error, Equatable, LocalizedError {
|
||||||
@@ -16,7 +16,7 @@ enum DeepLinkAgentPolicy {
|
|||||||
var errorDescription: String? {
|
var errorDescription: String? {
|
||||||
switch self {
|
switch self {
|
||||||
case let .messageTooLongForConfirmation(max, actual):
|
case let .messageTooLongForConfirmation(max, actual):
|
||||||
return "Message is too long to confirm safely (\(actual) chars; max \(max) without key)."
|
"Message is too long to confirm safely (\(actual) chars; max \(max) without key)."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,9 +49,9 @@ final class DeepLinkHandler {
|
|||||||
|
|
||||||
private var lastPromptAt: Date = .distantPast
|
private var lastPromptAt: Date = .distantPast
|
||||||
|
|
||||||
// Ephemeral, in-memory key used for unattended deep links originating from the in-app Canvas.
|
/// Ephemeral, in-memory key used for unattended deep links originating from the in-app Canvas.
|
||||||
// This avoids blocking Canvas init on UserDefaults and doesn't weaken the external deep-link prompt:
|
/// This avoids blocking Canvas init on UserDefaults and doesn't weaken the external deep-link prompt:
|
||||||
// outside callers can't know this randomly generated key.
|
/// outside callers can't know this randomly generated key.
|
||||||
private nonisolated static let canvasUnattendedKey: String = DeepLinkHandler.generateRandomKey()
|
private nonisolated static let canvasUnattendedKey: String = DeepLinkHandler.generateRandomKey()
|
||||||
|
|
||||||
func handle(url: URL) async {
|
func handle(url: URL) async {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@@ -23,8 +23,13 @@ final class DevicePairingApprovalPrompter {
|
|||||||
private var resolvedByRequestId: Set<String> = []
|
private var resolvedByRequestId: Set<String> = []
|
||||||
|
|
||||||
private final class AlertHostWindow: NSWindow {
|
private final class AlertHostWindow: NSWindow {
|
||||||
override var canBecomeKey: Bool { true }
|
override var canBecomeKey: Bool {
|
||||||
override var canBecomeMain: Bool { true }
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
override var canBecomeMain: Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct PairingList: Codable {
|
private struct PairingList: Codable {
|
||||||
@@ -55,7 +60,9 @@ final class DevicePairingApprovalPrompter {
|
|||||||
let isRepair: Bool?
|
let isRepair: Bool?
|
||||||
let ts: Double
|
let ts: Double
|
||||||
|
|
||||||
var id: String { self.requestId }
|
var id: String {
|
||||||
|
self.requestId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct PairingResolvedEvent: Codable {
|
private struct PairingResolvedEvent: Codable {
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ enum ExecSecurity: String, CaseIterable, Codable, Identifiable {
|
|||||||
case allowlist
|
case allowlist
|
||||||
case full
|
case full
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -24,7 +26,9 @@ enum ExecApprovalQuickMode: String, CaseIterable, Identifiable {
|
|||||||
case ask
|
case ask
|
||||||
case allow
|
case allow
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -67,7 +71,9 @@ enum ExecAsk: String, CaseIterable, Codable, Identifiable {
|
|||||||
case onMiss = "on-miss"
|
case onMiss = "on-miss"
|
||||||
case always
|
case always
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import CoreGraphics
|
import CoreGraphics
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import OpenClawKit
|
|
||||||
import CryptoKit
|
import CryptoKit
|
||||||
import Darwin
|
import Darwin
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
struct ExecApprovalPromptRequest: Codable, Sendable {
|
struct ExecApprovalPromptRequest: Codable, Sendable {
|
||||||
@@ -76,7 +76,9 @@ private struct ExecHostResponse: Codable {
|
|||||||
enum ExecApprovalsSocketClient {
|
enum ExecApprovalsSocketClient {
|
||||||
private struct TimeoutError: LocalizedError {
|
private struct TimeoutError: LocalizedError {
|
||||||
var message: String
|
var message: String
|
||||||
var errorDescription: String? { self.message }
|
var errorDescription: String? {
|
||||||
|
self.message
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func requestDecision(
|
static func requestDecision(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import Foundation
|
||||||
import OpenClawChatUI
|
import OpenClawChatUI
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import OpenClawProtocol
|
import OpenClawProtocol
|
||||||
import Foundation
|
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
private let gatewayConnectionLogger = Logger(subsystem: "ai.openclaw", category: "gateway.connection")
|
private let gatewayConnectionLogger = Logger(subsystem: "ai.openclaw", category: "gateway.connection")
|
||||||
@@ -24,9 +24,13 @@ enum GatewayAgentChannel: String, Codable, CaseIterable, Sendable {
|
|||||||
self = GatewayAgentChannel(rawValue: normalized) ?? .last
|
self = GatewayAgentChannel(rawValue: normalized) ?? .last
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDeliverable: Bool { self != .webchat }
|
var isDeliverable: Bool {
|
||||||
|
self != .webchat
|
||||||
|
}
|
||||||
|
|
||||||
func shouldDeliver(_ deliver: Bool) -> Bool { deliver && self.isDeliverable }
|
func shouldDeliver(_ deliver: Bool) -> Bool {
|
||||||
|
deliver && self.isDeliverable
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GatewayAgentInvocation: Sendable {
|
struct GatewayAgentInvocation: Sendable {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawDiscovery
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawDiscovery
|
||||||
|
|
||||||
enum GatewayDiscoveryHelpers {
|
enum GatewayDiscoveryHelpers {
|
||||||
static func sshTarget(for gateway: GatewayDiscoveryModel.DiscoveredGateway) -> String? {
|
static func sshTarget(for gateway: GatewayDiscoveryModel.DiscoveredGateway) -> String? {
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
import OpenClawIPC
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawIPC
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
// Lightweight SemVer helper (major.minor.patch only) for gateway compatibility checks.
|
/// Lightweight SemVer helper (major.minor.patch only) for gateway compatibility checks.
|
||||||
struct Semver: Comparable, CustomStringConvertible, Sendable {
|
struct Semver: Comparable, CustomStringConvertible, Sendable {
|
||||||
let major: Int
|
let major: Int
|
||||||
let minor: Int
|
let minor: Int
|
||||||
let patch: Int
|
let patch: Int
|
||||||
|
|
||||||
var description: String { "\(self.major).\(self.minor).\(self.patch)" }
|
var description: String {
|
||||||
|
"\(self.major).\(self.minor).\(self.patch)"
|
||||||
|
}
|
||||||
|
|
||||||
static func < (lhs: Semver, rhs: Semver) -> Bool {
|
static func < (lhs: Semver, rhs: Semver) -> Bool {
|
||||||
if lhs.major != rhs.major { return lhs.major < rhs.major }
|
if lhs.major != rhs.major { return lhs.major < rhs.major }
|
||||||
@@ -93,7 +95,7 @@ enum GatewayEnvironment {
|
|||||||
return (trimmed?.isEmpty == false) ? trimmed : nil
|
return (trimmed?.isEmpty == false) ? trimmed : nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exposed for tests so we can inject fake version checks without rewriting bundle metadata.
|
/// Exposed for tests so we can inject fake version checks without rewriting bundle metadata.
|
||||||
static func expectedGatewayVersion(from versionString: String?) -> Semver? {
|
static func expectedGatewayVersion(from versionString: String?) -> Semver? {
|
||||||
Semver.parse(versionString)
|
Semver.parse(versionString)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Observation
|
||||||
import OpenClawDiscovery
|
import OpenClawDiscovery
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Observation
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct GeneralSettings: View {
|
struct GeneralSettings: View {
|
||||||
@@ -16,8 +16,13 @@ struct GeneralSettings: View {
|
|||||||
@State private var remoteStatus: RemoteStatus = .idle
|
@State private var remoteStatus: RemoteStatus = .idle
|
||||||
@State private var showRemoteAdvanced = false
|
@State private var showRemoteAdvanced = false
|
||||||
private let isPreview = ProcessInfo.processInfo.isPreview
|
private let isPreview = ProcessInfo.processInfo.isPreview
|
||||||
private var isNixMode: Bool { ProcessInfo.processInfo.isNixMode }
|
private var isNixMode: Bool {
|
||||||
private var remoteLabelWidth: CGFloat { 88 }
|
ProcessInfo.processInfo.isNixMode
|
||||||
|
}
|
||||||
|
|
||||||
|
private var remoteLabelWidth: CGFloat {
|
||||||
|
88
|
||||||
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical) {
|
ScrollView(.vertical) {
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ final class HealthStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test-only escape hatch: the HealthStore is a process-wide singleton but
|
/// Test-only escape hatch: the HealthStore is a process-wide singleton but
|
||||||
// state derivation is pure from `snapshot` + `lastError`.
|
/// state derivation is pure from `snapshot` + `lastError`.
|
||||||
func __setSnapshotForTest(_ snapshot: HealthSnapshot?, lastError: String? = nil) {
|
func __setSnapshotForTest(_ snapshot: HealthSnapshot?, lastError: String? = nil) {
|
||||||
self.snapshot = snapshot
|
self.snapshot = snapshot
|
||||||
self.lastError = lastError
|
self.lastError = lastError
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ enum IconOverrideSelection: String, CaseIterable, Identifiable {
|
|||||||
case mainBash, mainRead, mainWrite, mainEdit, mainOther
|
case mainBash, mainRead, mainWrite, mainEdit, mainOther
|
||||||
case otherBash, otherRead, otherWrite, otherEdit, otherOther
|
case otherBash, otherRead, otherWrite, otherEdit, otherOther
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var label: String {
|
var label: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Cocoa
|
import Cocoa
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
struct InstanceInfo: Identifiable, Codable {
|
struct InstanceInfo: Identifiable, Codable {
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ enum LogLocator {
|
|||||||
{
|
{
|
||||||
return URL(fileURLWithPath: override)
|
return URL(fileURLWithPath: override)
|
||||||
}
|
}
|
||||||
let preferred = URL(fileURLWithPath: "/tmp/openclaw")
|
return URL(fileURLWithPath: "/tmp/openclaw")
|
||||||
return preferred
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var stdoutLog: URL {
|
private static var stdoutLog: URL {
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ enum AppLogLevel: String, CaseIterable, Identifiable {
|
|||||||
|
|
||||||
static let `default`: AppLogLevel = .info
|
static let `default`: AppLogLevel = .info
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ protocol UpdaterProviding: AnyObject {
|
|||||||
func checkForUpdates(_ sender: Any?)
|
func checkForUpdates(_ sender: Any?)
|
||||||
}
|
}
|
||||||
|
|
||||||
// No-op updater used for debug/dev runs to suppress Sparkle dialogs.
|
/// No-op updater used for debug/dev runs to suppress Sparkle dialogs.
|
||||||
final class DisabledUpdaterController: UpdaterProviding {
|
final class DisabledUpdaterController: UpdaterProviding {
|
||||||
var automaticallyChecksForUpdates: Bool = false
|
var automaticallyChecksForUpdates: Bool = false
|
||||||
var automaticallyDownloadsUpdates: Bool = false
|
var automaticallyDownloadsUpdates: Bool = false
|
||||||
@@ -394,7 +394,9 @@ final class SparkleUpdaterController: NSObject, UpdaterProviding {
|
|||||||
set { self.controller.updater.automaticallyDownloadsUpdates = newValue }
|
set { self.controller.updater.automaticallyDownloadsUpdates = newValue }
|
||||||
}
|
}
|
||||||
|
|
||||||
var isAvailable: Bool { true }
|
var isAvailable: Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
func checkForUpdates(_ sender: Any?) {
|
func checkForUpdates(_ sender: Any?) {
|
||||||
self.controller.checkForUpdates(sender)
|
self.controller.checkForUpdates(sender)
|
||||||
|
|||||||
@@ -400,7 +400,6 @@ struct MenuContent: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func statusLine(label: String, color: Color) -> some View {
|
private func statusLine(label: String, color: Color) -> some View {
|
||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Circle()
|
Circle()
|
||||||
@@ -590,6 +589,8 @@ struct MenuContent: View {
|
|||||||
private struct AudioInputDevice: Identifiable, Equatable {
|
private struct AudioInputDevice: Identifiable, Equatable {
|
||||||
let uid: String
|
let uid: String
|
||||||
let name: String
|
let name: String
|
||||||
var id: String { self.uid }
|
var id: String {
|
||||||
|
self.uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ final class HighlightedMenuItemHostView: NSView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
override var intrinsicContentSize: NSSize {
|
override var intrinsicContentSize: NSSize {
|
||||||
let size = self.hosting.fittingSize
|
let size = self.hosting.fittingSize
|
||||||
|
|||||||
@@ -159,7 +159,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate {
|
|||||||
extension MenuSessionsInjector {
|
extension MenuSessionsInjector {
|
||||||
// MARK: - Injection
|
// MARK: - Injection
|
||||||
|
|
||||||
private var mainSessionKey: String { WorkActivityStore.shared.mainSessionKey }
|
private var mainSessionKey: String {
|
||||||
|
WorkActivityStore.shared.mainSessionKey
|
||||||
|
}
|
||||||
|
|
||||||
private func inject(into menu: NSMenu) {
|
private func inject(into menu: NSMenu) {
|
||||||
self.cancelPreviewTasks()
|
self.cancelPreviewTasks()
|
||||||
@@ -1175,8 +1177,7 @@ extension MenuSessionsInjector {
|
|||||||
|
|
||||||
private func makeHostedView(rootView: AnyView, width: CGFloat, highlighted: Bool) -> NSView {
|
private func makeHostedView(rootView: AnyView, width: CGFloat, highlighted: Bool) -> NSView {
|
||||||
if highlighted {
|
if highlighted {
|
||||||
let container = HighlightedMenuItemHostView(rootView: rootView, width: width)
|
return HighlightedMenuItemHostView(rootView: rootView, width: width)
|
||||||
return container
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let hosting = NSHostingView(rootView: rootView)
|
let hosting = NSHostingView(rootView: rootView)
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ actor MicLevelMonitor {
|
|||||||
}
|
}
|
||||||
let rms = sqrt(sum / Float(frameCount) + 1e-12)
|
let rms = sqrt(sum / Float(frameCount) + 1e-12)
|
||||||
let db = 20 * log10(Double(rms))
|
let db = 20 * log10(Double(rms))
|
||||||
let normalized = max(0, min(1, (db + 50) / 50))
|
return max(0, min(1, (db + 50) / 50))
|
||||||
return normalized
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ import Foundation
|
|||||||
import JavaScriptCore
|
import JavaScriptCore
|
||||||
|
|
||||||
enum ModelCatalogLoader {
|
enum ModelCatalogLoader {
|
||||||
static var defaultPath: String { self.resolveDefaultPath() }
|
static var defaultPath: String {
|
||||||
|
self.resolveDefaultPath()
|
||||||
|
}
|
||||||
|
|
||||||
private static let logger = Logger(subsystem: "ai.openclaw", category: "models")
|
private static let logger = Logger(subsystem: "ai.openclaw", category: "models")
|
||||||
private nonisolated static let appSupportDir: URL = {
|
private nonisolated static let appSupportDir: URL = {
|
||||||
let base = FileManager().urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
|
let base = FileManager().urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import OpenClawKit
|
|
||||||
import CoreLocation
|
import CoreLocation
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
final class MacNodeLocationService: NSObject, CLLocationManagerDelegate {
|
final class MacNodeLocationService: NSObject, CLLocationManagerDelegate {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Foundation
|
|
||||||
|
|
||||||
actor MacNodeRuntime {
|
actor MacNodeRuntime {
|
||||||
private let cameraCapture = CameraCaptureService()
|
private let cameraCapture = CameraCaptureService()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import OpenClawKit
|
|
||||||
import CoreLocation
|
import CoreLocation
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
protocol MacNodeRuntimeMainActorServices: Sendable {
|
protocol MacNodeRuntimeMainActorServices: Sendable {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
|
import Observation
|
||||||
import OpenClawDiscovery
|
import OpenClawDiscovery
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import OpenClawProtocol
|
import OpenClawProtocol
|
||||||
import Foundation
|
|
||||||
import Observation
|
|
||||||
import OSLog
|
import OSLog
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
|
|
||||||
@@ -39,8 +39,13 @@ final class NodePairingApprovalPrompter {
|
|||||||
private var autoApproveAttempts: Set<String> = []
|
private var autoApproveAttempts: Set<String> = []
|
||||||
|
|
||||||
private final class AlertHostWindow: NSWindow {
|
private final class AlertHostWindow: NSWindow {
|
||||||
override var canBecomeKey: Bool { true }
|
override var canBecomeKey: Bool {
|
||||||
override var canBecomeMain: Bool { true }
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
override var canBecomeMain: Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct PairingList: Codable {
|
private struct PairingList: Codable {
|
||||||
@@ -68,7 +73,9 @@ final class NodePairingApprovalPrompter {
|
|||||||
let silent: Bool?
|
let silent: Bool?
|
||||||
let ts: Double
|
let ts: Double
|
||||||
|
|
||||||
var id: String { self.requestId }
|
var id: String {
|
||||||
|
self.requestId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct PairingResolvedEvent: Codable {
|
private struct PairingResolvedEvent: Codable {
|
||||||
|
|||||||
@@ -18,9 +18,17 @@ struct NodeInfo: Identifiable, Codable {
|
|||||||
let paired: Bool?
|
let paired: Bool?
|
||||||
let connected: Bool?
|
let connected: Bool?
|
||||||
|
|
||||||
var id: String { self.nodeId }
|
var id: String {
|
||||||
var isConnected: Bool { self.connected ?? false }
|
self.nodeId
|
||||||
var isPaired: Bool { self.paired ?? false }
|
}
|
||||||
|
|
||||||
|
var isConnected: Bool {
|
||||||
|
self.connected ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
var isPaired: Bool {
|
||||||
|
self.paired ?? false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct NodeListResponse: Codable {
|
private struct NodeListResponse: Codable {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawIPC
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawIPC
|
||||||
import Security
|
import Security
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ final class NotifyOverlayController {
|
|||||||
static let shared = NotifyOverlayController()
|
static let shared = NotifyOverlayController()
|
||||||
|
|
||||||
private(set) var model = Model()
|
private(set) var model = Model()
|
||||||
var isVisible: Bool { self.model.isVisible }
|
var isVisible: Bool {
|
||||||
|
self.model.isVisible
|
||||||
|
}
|
||||||
|
|
||||||
struct Model {
|
struct Model {
|
||||||
var title: String = ""
|
var title: String = ""
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Combine
|
||||||
|
import Observation
|
||||||
import OpenClawChatUI
|
import OpenClawChatUI
|
||||||
import OpenClawDiscovery
|
import OpenClawDiscovery
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import Combine
|
|
||||||
import Observation
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
enum UIStrings {
|
enum UIStrings {
|
||||||
@@ -142,18 +142,30 @@ struct OnboardingView: View {
|
|||||||
Self.pageOrder(for: self.state.connectionMode, showOnboardingChat: self.showOnboardingChat)
|
Self.pageOrder(for: self.state.connectionMode, showOnboardingChat: self.showOnboardingChat)
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageCount: Int { self.pageOrder.count }
|
var pageCount: Int {
|
||||||
|
self.pageOrder.count
|
||||||
|
}
|
||||||
|
|
||||||
var activePageIndex: Int {
|
var activePageIndex: Int {
|
||||||
self.activePageIndex(for: self.currentPage)
|
self.activePageIndex(for: self.currentPage)
|
||||||
}
|
}
|
||||||
|
|
||||||
var buttonTitle: String { self.currentPage == self.pageCount - 1 ? "Finish" : "Next" }
|
var buttonTitle: String {
|
||||||
var wizardPageOrderIndex: Int? { self.pageOrder.firstIndex(of: self.wizardPageIndex) }
|
self.currentPage == self.pageCount - 1 ? "Finish" : "Next"
|
||||||
|
}
|
||||||
|
|
||||||
|
var wizardPageOrderIndex: Int? {
|
||||||
|
self.pageOrder.firstIndex(of: self.wizardPageIndex)
|
||||||
|
}
|
||||||
|
|
||||||
var isWizardBlocking: Bool {
|
var isWizardBlocking: Bool {
|
||||||
self.activePageIndex == self.wizardPageIndex && !self.onboardingWizard.isComplete
|
self.activePageIndex == self.wizardPageIndex && !self.onboardingWizard.isComplete
|
||||||
}
|
}
|
||||||
|
|
||||||
var canAdvance: Bool { !self.isWizardBlocking }
|
var canAdvance: Bool {
|
||||||
|
!self.isWizardBlocking
|
||||||
|
}
|
||||||
|
|
||||||
var devLinkCommand: String {
|
var devLinkCommand: String {
|
||||||
let version = GatewayEnvironment.expectedGatewayVersionString() ?? "latest"
|
let version = GatewayEnvironment.expectedGatewayVersionString() ?? "latest"
|
||||||
return "npm install -g openclaw@\(version)"
|
return "npm install -g openclaw@\(version)"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawDiscovery
|
import OpenClawDiscovery
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import Foundation
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
extension OnboardingView {
|
extension OnboardingView {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawIPC
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawIPC
|
||||||
|
|
||||||
extension OnboardingView {
|
extension OnboardingView {
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -206,7 +206,9 @@ extension OnboardingView {
|
|||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.frame(width: fieldWidth)
|
.frame(width: fieldWidth)
|
||||||
}
|
}
|
||||||
if let message = CommandResolver.sshTargetValidationMessage(self.state.remoteTarget) {
|
if let message = CommandResolver
|
||||||
|
.sshTargetValidationMessage(self.state.remoteTarget)
|
||||||
|
{
|
||||||
GridRow {
|
GridRow {
|
||||||
Text("")
|
Text("")
|
||||||
.frame(width: labelWidth, alignment: .leading)
|
.frame(width: labelWidth, alignment: .leading)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
extension OnboardingView {
|
extension OnboardingView {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ extension OnboardingView {
|
|||||||
} catch {
|
} catch {
|
||||||
self.workspaceStatus = "Failed to create workspace: \(error.localizedDescription)"
|
self.workspaceStatus = "Failed to create workspace: \(error.localizedDescription)"
|
||||||
}
|
}
|
||||||
case let .unsafe(reason):
|
case let .unsafe (reason):
|
||||||
self.workspaceStatus = "Workspace not touched: \(reason)"
|
self.workspaceStatus = "Workspace not touched: \(reason)"
|
||||||
}
|
}
|
||||||
self.refreshBootstrapStatus()
|
self.refreshBootstrapStatus()
|
||||||
@@ -54,7 +54,7 @@ extension OnboardingView {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
let url = AgentWorkspace.resolveWorkspaceURL(from: self.workspacePath)
|
let url = AgentWorkspace.resolveWorkspaceURL(from: self.workspacePath)
|
||||||
if case let .unsafe(reason) = AgentWorkspace.bootstrapSafety(for: url) {
|
if case let .unsafe (reason) = AgentWorkspace.bootstrapSafety(for: url) {
|
||||||
self.workspaceStatus = "Workspace not created: \(reason)"
|
self.workspaceStatus = "Workspace not created: \(reason)"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import OSLog
|
import OSLog
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@@ -41,8 +41,13 @@ final class OnboardingWizardModel {
|
|||||||
private var restartAttempts = 0
|
private var restartAttempts = 0
|
||||||
private let maxRestartAttempts = 1
|
private let maxRestartAttempts = 1
|
||||||
|
|
||||||
var isComplete: Bool { self.status == "done" }
|
var isComplete: Bool {
|
||||||
var isRunning: Bool { self.status == "running" }
|
self.status == "done"
|
||||||
|
}
|
||||||
|
|
||||||
|
var isRunning: Bool {
|
||||||
|
self.status == "running"
|
||||||
|
}
|
||||||
|
|
||||||
func reset() {
|
func reset() {
|
||||||
self.sessionId = nil
|
self.sessionId = nil
|
||||||
@@ -408,5 +413,7 @@ private struct WizardOptionItem: Identifiable {
|
|||||||
let index: Int
|
let index: Int
|
||||||
let option: WizardOption
|
let option: WizardOption
|
||||||
|
|
||||||
var id: Int { self.index }
|
var id: Int {
|
||||||
|
self.index
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
enum OpenClawConfigFile {
|
enum OpenClawConfigFile {
|
||||||
private static let logger = Logger(subsystem: "ai.openclaw", category: "config")
|
private static let logger = Logger(subsystem: "ai.openclaw", category: "config")
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ enum OpenClawPaths {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let home = FileManager().homeDirectoryForCurrentUser
|
let home = FileManager().homeDirectoryForCurrentUser
|
||||||
let preferred = home.appendingPathComponent(".openclaw", isDirectory: true)
|
return home.appendingPathComponent(".openclaw", isDirectory: true)
|
||||||
return preferred
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func resolveConfigCandidate(in dir: URL) -> URL? {
|
private static func resolveConfigCandidate(in dir: URL) -> URL? {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import ApplicationServices
|
import ApplicationServices
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import OpenClawIPC
|
|
||||||
import CoreGraphics
|
import CoreGraphics
|
||||||
import CoreLocation
|
import CoreLocation
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawIPC
|
||||||
import Speech
|
import Speech
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ final class LocationPermissionRequester: NSObject, CLLocationManagerDelegate {
|
|||||||
cont.resume(returning: status)
|
cont.resume(returning: status)
|
||||||
}
|
}
|
||||||
|
|
||||||
// nonisolated for Swift 6 strict concurrency compatibility
|
/// nonisolated for Swift 6 strict concurrency compatibility
|
||||||
nonisolated func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
|
nonisolated func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
|
||||||
let status = manager.authorizationStatus
|
let status = manager.authorizationStatus
|
||||||
Task { @MainActor in
|
Task { @MainActor in
|
||||||
@@ -344,7 +344,7 @@ final class LocationPermissionRequester: NSObject, CLLocationManagerDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy callback (still used on some macOS versions / configurations).
|
/// Legacy callback (still used on some macOS versions / configurations).
|
||||||
nonisolated func locationManager(
|
nonisolated func locationManager(
|
||||||
_ manager: CLLocationManager,
|
_ manager: CLLocationManager,
|
||||||
didChangeAuthorization status: CLAuthorizationStatus)
|
didChangeAuthorization status: CLAuthorizationStatus)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import CoreLocation
|
||||||
import OpenClawIPC
|
import OpenClawIPC
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import CoreLocation
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct PermissionsSettings: View {
|
struct PermissionsSettings: View {
|
||||||
@@ -164,7 +164,9 @@ struct PermissionRow: View {
|
|||||||
.padding(.vertical, self.compact ? 4 : 6)
|
.padding(.vertical, self.compact ? 4 : 6)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var iconSize: CGFloat { self.compact ? 28 : 32 }
|
private var iconSize: CGFloat {
|
||||||
|
self.compact ? 28 : 32
|
||||||
|
}
|
||||||
|
|
||||||
private var title: String {
|
private var title: String {
|
||||||
switch self.capability {
|
switch self.capability {
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ actor PortGuardian {
|
|||||||
let status: Status
|
let status: Status
|
||||||
let listeners: [ReportListener]
|
let listeners: [ReportListener]
|
||||||
|
|
||||||
var id: Int { self.port }
|
var id: Int {
|
||||||
|
self.port
|
||||||
|
}
|
||||||
|
|
||||||
var offenders: [ReportListener] {
|
var offenders: [ReportListener] {
|
||||||
if case let .interference(_, offenders) = self.status { return offenders }
|
if case let .interference(_, offenders) = self.status { return offenders }
|
||||||
@@ -141,7 +143,9 @@ actor PortGuardian {
|
|||||||
let user: String?
|
let user: String?
|
||||||
let expected: Bool
|
let expected: Bool
|
||||||
|
|
||||||
var id: Int32 { self.pid }
|
var id: Int32 {
|
||||||
|
self.pid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func diagnose(mode: AppState.ConnectionMode) async -> [PortReport] {
|
func diagnose(mode: AppState.ConnectionMode) async -> [PortReport] {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ extension ProcessInfo {
|
|||||||
environment: [String: String],
|
environment: [String: String],
|
||||||
standard: UserDefaults,
|
standard: UserDefaults,
|
||||||
stableSuite: UserDefaults?,
|
stableSuite: UserDefaults?,
|
||||||
isAppBundle: Bool
|
isAppBundle: Bool) -> Bool
|
||||||
) -> Bool {
|
{
|
||||||
if environment["OPENCLAW_NIX_MODE"] == "1" { return true }
|
if environment["OPENCLAW_NIX_MODE"] == "1" { return true }
|
||||||
if standard.bool(forKey: "openclaw.nixMode") { return true }
|
if standard.bool(forKey: "openclaw.nixMode") { return true }
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ struct RuntimeVersion: Comparable, CustomStringConvertible {
|
|||||||
let minor: Int
|
let minor: Int
|
||||||
let patch: Int
|
let patch: Int
|
||||||
|
|
||||||
var description: String { "\(self.major).\(self.minor).\(self.patch)" }
|
var description: String {
|
||||||
|
"\(self.major).\(self.minor).\(self.patch)"
|
||||||
|
}
|
||||||
|
|
||||||
static func < (lhs: RuntimeVersion, rhs: RuntimeVersion) -> Bool {
|
static func < (lhs: RuntimeVersion, rhs: RuntimeVersion) -> Bool {
|
||||||
if lhs.major != rhs.major { return lhs.major < rhs.major }
|
if lhs.major != rhs.major { return lhs.major < rhs.major }
|
||||||
@@ -163,5 +165,7 @@ enum RuntimeLocator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension RuntimeKind {
|
extension RuntimeKind {
|
||||||
fileprivate var binaryName: String { "node" }
|
fileprivate var binaryName: String {
|
||||||
|
"node"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,13 @@ struct SessionRow: Identifiable {
|
|||||||
let tokens: SessionTokenStats
|
let tokens: SessionTokenStats
|
||||||
let model: String?
|
let model: String?
|
||||||
|
|
||||||
var ageText: String { relativeAge(from: self.updatedAt) }
|
var ageText: String {
|
||||||
var label: String { self.displayName ?? self.key }
|
relativeAge(from: self.updatedAt)
|
||||||
|
}
|
||||||
|
|
||||||
|
var label: String {
|
||||||
|
self.displayName ?? self.key
|
||||||
|
}
|
||||||
|
|
||||||
var flagLabels: [String] {
|
var flagLabels: [String] {
|
||||||
var flags: [String] = []
|
var flags: [String] = []
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
private struct MenuItemHighlightedKey: EnvironmentKey {
|
|
||||||
static let defaultValue = false
|
|
||||||
}
|
|
||||||
|
|
||||||
extension EnvironmentValues {
|
extension EnvironmentValues {
|
||||||
var menuItemHighlighted: Bool {
|
@Entry var menuItemHighlighted: Bool = false
|
||||||
get { self[MenuItemHighlightedKey.self] }
|
|
||||||
set { self[MenuItemHighlightedKey.self] = newValue }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SessionMenuLabelView: View {
|
struct SessionMenuLabelView: View {
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ struct SessionMenuPreviewView: View {
|
|||||||
.frame(width: max(1, self.width), alignment: .leading)
|
.frame(width: max(1, self.width), alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func previewRow(_ item: SessionPreviewItem) -> some View {
|
private func previewRow(_ item: SessionPreviewItem) -> some View {
|
||||||
HStack(alignment: .top, spacing: 4) {
|
HStack(alignment: .top, spacing: 4) {
|
||||||
Text(item.role.label)
|
Text(item.role.label)
|
||||||
@@ -212,7 +211,6 @@ struct SessionMenuPreviewView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func placeholder(_ text: String) -> some View {
|
private func placeholder(_ text: String) -> some View {
|
||||||
Text(text)
|
Text(text)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
@@ -227,7 +225,9 @@ enum SessionMenuPreviewLoader {
|
|||||||
private static let previewMaxChars = 240
|
private static let previewMaxChars = 240
|
||||||
|
|
||||||
private struct PreviewTimeoutError: LocalizedError {
|
private struct PreviewTimeoutError: LocalizedError {
|
||||||
var errorDescription: String? { "preview timeout" }
|
var errorDescription: String? {
|
||||||
|
"preview timeout"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func prewarm(sessionKeys: [String], maxItems: Int) async {
|
static func prewarm(sessionKeys: [String], maxItems: Int) async {
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ struct SessionsSettings: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func sessionRow(_ row: SessionRow) -> some View {
|
private func sessionRow(_ row: SessionRow) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawIPC
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawIPC
|
||||||
|
|
||||||
enum ShellExecutor {
|
enum ShellExecutor {
|
||||||
struct ShellResult {
|
struct ShellResult {
|
||||||
@@ -69,7 +69,7 @@ enum ShellExecutor {
|
|||||||
|
|
||||||
if let timeout, timeout > 0 {
|
if let timeout, timeout > 0 {
|
||||||
let nanos = UInt64(timeout * 1_000_000_000)
|
let nanos = UInt64(timeout * 1_000_000_000)
|
||||||
let result = await withTaskGroup(of: ShellResult.self) { group in
|
return await withTaskGroup(of: ShellResult.self) { group in
|
||||||
group.addTask { await waitTask.value }
|
group.addTask { await waitTask.value }
|
||||||
group.addTask {
|
group.addTask {
|
||||||
try? await Task.sleep(nanoseconds: nanos)
|
try? await Task.sleep(nanoseconds: nanos)
|
||||||
@@ -87,7 +87,6 @@ enum ShellExecutor {
|
|||||||
group.cancelAll()
|
group.cancelAll()
|
||||||
return first
|
return first
|
||||||
}
|
}
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await waitTask.value
|
return await waitTask.value
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
struct SkillsStatusReport: Codable {
|
struct SkillsStatusReport: Codable {
|
||||||
let workspaceDir: String
|
let workspaceDir: String
|
||||||
@@ -25,7 +25,9 @@ struct SkillStatus: Codable, Identifiable {
|
|||||||
let configChecks: [SkillStatusConfigCheck]
|
let configChecks: [SkillStatusConfigCheck]
|
||||||
let install: [SkillInstallOption]
|
let install: [SkillInstallOption]
|
||||||
|
|
||||||
var id: String { self.name }
|
var id: String {
|
||||||
|
self.name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SkillRequirements: Codable {
|
struct SkillRequirements: Codable {
|
||||||
@@ -45,7 +47,9 @@ struct SkillStatusConfigCheck: Codable, Identifiable {
|
|||||||
let value: AnyCodable?
|
let value: AnyCodable?
|
||||||
let satisfied: Bool
|
let satisfied: Bool
|
||||||
|
|
||||||
var id: String { self.path }
|
var id: String {
|
||||||
|
self.path
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SkillInstallOption: Codable, Identifiable {
|
struct SkillInstallOption: Codable, Identifiable {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawProtocol
|
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct SkillsSettings: View {
|
struct SkillsSettings: View {
|
||||||
@@ -142,7 +142,9 @@ private enum SkillsFilter: String, CaseIterable, Identifiable {
|
|||||||
case needsSetup
|
case needsSetup
|
||||||
case disabled
|
case disabled
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -171,24 +173,16 @@ private struct SkillRow: View {
|
|||||||
let onInstall: (SkillInstallOption, InstallTarget) -> Void
|
let onInstall: (SkillInstallOption, InstallTarget) -> Void
|
||||||
let onSetEnv: (String, Bool) -> Void
|
let onSetEnv: (String, Bool) -> Void
|
||||||
|
|
||||||
private var missingBins: [String] { self.skill.missing.bins }
|
private var missingBins: [String] {
|
||||||
private var missingEnv: [String] { self.skill.missing.env }
|
self.skill.missing.bins
|
||||||
private var missingConfig: [String] { self.skill.missing.config }
|
}
|
||||||
|
|
||||||
init(
|
private var missingEnv: [String] {
|
||||||
skill: SkillStatus,
|
self.skill.missing.env
|
||||||
isBusy: Bool,
|
}
|
||||||
connectionMode: AppState.ConnectionMode,
|
|
||||||
onToggleEnabled: @escaping (Bool) -> Void,
|
private var missingConfig: [String] {
|
||||||
onInstall: @escaping (SkillInstallOption, InstallTarget) -> Void,
|
self.skill.missing.config
|
||||||
onSetEnv: @escaping (String, Bool) -> Void)
|
|
||||||
{
|
|
||||||
self.skill = skill
|
|
||||||
self.isBusy = isBusy
|
|
||||||
self.connectionMode = connectionMode
|
|
||||||
self.onToggleEnabled = onToggleEnabled
|
|
||||||
self.onInstall = onInstall
|
|
||||||
self.onSetEnv = onSetEnv
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -274,7 +268,6 @@ private struct SkillRow: View {
|
|||||||
set: { self.onToggleEnabled($0) })
|
set: { self.onToggleEnabled($0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var missingSummary: some View {
|
private var missingSummary: some View {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
if self.shouldShowMissingBins {
|
if self.shouldShowMissingBins {
|
||||||
@@ -295,7 +288,6 @@ private struct SkillRow: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var configChecksView: some View {
|
private var configChecksView: some View {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
ForEach(self.skill.configChecks) { check in
|
ForEach(self.skill.configChecks) { check in
|
||||||
@@ -326,7 +318,6 @@ private struct SkillRow: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var trailingActions: some View {
|
private var trailingActions: some View {
|
||||||
VStack(alignment: .trailing, spacing: 8) {
|
VStack(alignment: .trailing, spacing: 8) {
|
||||||
if !self.installOptions.isEmpty {
|
if !self.installOptions.isEmpty {
|
||||||
@@ -438,7 +429,9 @@ private struct EnvEditorState: Identifiable {
|
|||||||
let envKey: String
|
let envKey: String
|
||||||
let isPrimary: Bool
|
let isPrimary: Bool
|
||||||
|
|
||||||
var id: String { "\(self.skillKey)::\(self.envKey)" }
|
var id: String {
|
||||||
|
"\(self.skillKey)::\(self.envKey)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct EnvEditorView: View {
|
private struct EnvEditorView: View {
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ enum SoundEffectCatalog {
|
|||||||
return ["Glass"] + sorted
|
return ["Glass"] + sorted
|
||||||
}
|
}
|
||||||
|
|
||||||
static func displayName(for raw: String) -> String { raw }
|
static func displayName(for raw: String) -> String {
|
||||||
|
raw
|
||||||
|
}
|
||||||
|
|
||||||
static func url(for name: String) -> URL? {
|
static func url(for name: String) -> URL? {
|
||||||
self.discoveredSoundMap[name]
|
self.discoveredSoundMap[name]
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ private enum ExecApprovalsSettingsTab: String, CaseIterable, Identifiable {
|
|||||||
case policy
|
case policy
|
||||||
case allowlist
|
case allowlist
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ private enum GatewayTailscaleMode: String, CaseIterable, Identifiable {
|
|||||||
case serve
|
case serve
|
||||||
case funnel
|
case funnel
|
||||||
|
|
||||||
var id: String { self.rawValue }
|
var id: String {
|
||||||
|
self.rawValue
|
||||||
|
}
|
||||||
|
|
||||||
var label: String {
|
var label: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import AVFoundation
|
import AVFoundation
|
||||||
|
import Foundation
|
||||||
import OpenClawChatUI
|
import OpenClawChatUI
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import Foundation
|
|
||||||
import OSLog
|
import OSLog
|
||||||
import Speech
|
import Speech
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,13 @@ private final class OrbInteractionNSView: NSView {
|
|||||||
private var didDrag = false
|
private var didDrag = false
|
||||||
private var suppressSingleClick = false
|
private var suppressSingleClick = false
|
||||||
|
|
||||||
override var acceptsFirstResponder: Bool { true }
|
override var acceptsFirstResponder: Bool {
|
||||||
override func acceptsFirstMouse(for event: NSEvent?) -> Bool { true }
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
override func acceptsFirstMouse(for event: NSEvent?) -> Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
override func mouseDown(with event: NSEvent) {
|
override func mouseDown(with event: NSEvent) {
|
||||||
self.mouseDownEvent = event
|
self.mouseDownEvent = event
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ struct UsageRow: Identifiable {
|
|||||||
|
|
||||||
var remainingPercent: Int? {
|
var remainingPercent: Int? {
|
||||||
guard let usedPercent, usedPercent.isFinite else { return nil }
|
guard let usedPercent, usedPercent.isFinite else { return nil }
|
||||||
let remaining = max(0, min(100, Int(round(100 - usedPercent))))
|
return max(0, min(100, Int(round(100 - usedPercent))))
|
||||||
return remaining
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func detailText(now: Date = .init()) -> String {
|
func detailText(now: Date = .init()) -> String {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ actor VoicePushToTalk {
|
|||||||
private var recognitionTask: SFSpeechRecognitionTask?
|
private var recognitionTask: SFSpeechRecognitionTask?
|
||||||
private var tapInstalled = false
|
private var tapInstalled = false
|
||||||
|
|
||||||
// Session token used to drop stale callbacks when a new capture starts.
|
/// Session token used to drop stale callbacks when a new capture starts.
|
||||||
private var sessionID = UUID()
|
private var sessionID = UUID()
|
||||||
|
|
||||||
private var committed: String = ""
|
private var committed: String = ""
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ enum VoiceWakeChime: Codable, Equatable, Sendable {
|
|||||||
|
|
||||||
enum VoiceWakeChimeCatalog {
|
enum VoiceWakeChimeCatalog {
|
||||||
/// Options shown in the picker.
|
/// Options shown in the picker.
|
||||||
static var systemOptions: [String] { SoundEffectCatalog.systemOptions }
|
static var systemOptions: [String] {
|
||||||
|
SoundEffectCatalog.systemOptions
|
||||||
|
}
|
||||||
|
|
||||||
static func displayName(for raw: String) -> String {
|
static func displayName(for raw: String) -> String {
|
||||||
SoundEffectCatalog.displayName(for: raw)
|
SoundEffectCatalog.displayName(for: raw)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ final class VoiceWakeOverlayController {
|
|||||||
enum Source: String { case wakeWord, pushToTalk }
|
enum Source: String { case wakeWord, pushToTalk }
|
||||||
|
|
||||||
var model = Model()
|
var model = Model()
|
||||||
var isVisible: Bool { self.model.isVisible }
|
var isVisible: Bool {
|
||||||
|
self.model.isVisible
|
||||||
|
}
|
||||||
|
|
||||||
struct Model {
|
struct Model {
|
||||||
var text: String = ""
|
var text: String = ""
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ struct TranscriptTextView: NSViewRepresentable {
|
|||||||
var onEndEditing: () -> Void
|
var onEndEditing: () -> Void
|
||||||
var onSend: () -> Void
|
var onSend: () -> Void
|
||||||
|
|
||||||
func makeCoordinator() -> Coordinator { Coordinator(self) }
|
func makeCoordinator() -> Coordinator {
|
||||||
|
Coordinator(self)
|
||||||
|
}
|
||||||
|
|
||||||
func makeNSView(context: Context) -> NSScrollView {
|
func makeNSView(context: Context) -> NSScrollView {
|
||||||
let textView = TranscriptNSTextView()
|
let textView = TranscriptNSTextView()
|
||||||
@@ -77,7 +79,9 @@ struct TranscriptTextView: NSViewRepresentable {
|
|||||||
var parent: TranscriptTextView
|
var parent: TranscriptTextView
|
||||||
var isProgrammaticUpdate = false
|
var isProgrammaticUpdate = false
|
||||||
|
|
||||||
init(_ parent: TranscriptTextView) { self.parent = parent }
|
init(_ parent: TranscriptTextView) {
|
||||||
|
self.parent = parent
|
||||||
|
}
|
||||||
|
|
||||||
func textDidBeginEditing(_ notification: Notification) {
|
func textDidBeginEditing(_ notification: Notification) {
|
||||||
self.parent.onBeginEditing()
|
self.parent.onBeginEditing()
|
||||||
@@ -147,7 +151,9 @@ private final class ClickCatcher: NSView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
override func mouseDown(with event: NSEvent) {
|
override func mouseDown(with event: NSEvent) {
|
||||||
super.mouseDown(with: event)
|
super.mouseDown(with: event)
|
||||||
|
|||||||
@@ -131,7 +131,9 @@ private struct OverlayBackground: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension OverlayBackground: @MainActor Equatable {
|
extension OverlayBackground: @MainActor Equatable {
|
||||||
static func == (lhs: Self, rhs: Self) -> Bool { true }
|
static func == (lhs: Self, rhs: Self) -> Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CloseHoverButton: View {
|
struct CloseHoverButton: View {
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ actor VoiceWakeRuntime {
|
|||||||
private var isStarting: Bool = false
|
private var isStarting: Bool = false
|
||||||
private var triggerOnlyTask: Task<Void, Never>?
|
private var triggerOnlyTask: Task<Void, Never>?
|
||||||
|
|
||||||
// Tunables
|
/// Tunables
|
||||||
// Silence threshold once we've captured user speech (post-trigger).
|
/// Silence threshold once we've captured user speech (post-trigger).
|
||||||
private let silenceWindow: TimeInterval = 2.0
|
private let silenceWindow: TimeInterval = 2.0
|
||||||
// Silence threshold when we only heard the trigger but no post-trigger speech yet.
|
/// Silence threshold when we only heard the trigger but no post-trigger speech yet.
|
||||||
private let triggerOnlySilenceWindow: TimeInterval = 5.0
|
private let triggerOnlySilenceWindow: TimeInterval = 5.0
|
||||||
// Maximum capture duration from trigger until we force-send, to avoid runaway sessions.
|
// Maximum capture duration from trigger until we force-send, to avoid runaway sessions.
|
||||||
private let captureHardStop: TimeInterval = 120.0
|
private let captureHardStop: TimeInterval = 120.0
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ struct VoiceWakeSettings: View {
|
|||||||
private struct AudioInputDevice: Identifiable, Equatable {
|
private struct AudioInputDevice: Identifiable, Equatable {
|
||||||
let uid: String
|
let uid: String
|
||||||
let name: String
|
let name: String
|
||||||
var id: String { self.uid }
|
var id: String {
|
||||||
|
self.uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct TriggerEntry: Identifiable {
|
private struct TriggerEntry: Identifiable {
|
||||||
|
|||||||
@@ -3,8 +3,13 @@ import Foundation
|
|||||||
|
|
||||||
/// A borderless panel that can still accept key focus (needed for typing).
|
/// A borderless panel that can still accept key focus (needed for typing).
|
||||||
final class WebChatPanel: NSPanel {
|
final class WebChatPanel: NSPanel {
|
||||||
override var canBecomeKey: Bool { true }
|
override var canBecomeKey: Bool {
|
||||||
override var canBecomeMain: Bool { true }
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
override var canBecomeMain: Bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum WebChatPresentation {
|
enum WebChatPresentation {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
import Foundation
|
||||||
import OpenClawChatUI
|
import OpenClawChatUI
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import OpenClawProtocol
|
import OpenClawProtocol
|
||||||
import Foundation
|
|
||||||
import OSLog
|
import OSLog
|
||||||
import QuartzCore
|
import QuartzCore
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@@ -31,7 +31,9 @@ final class WorkActivityStore {
|
|||||||
private var mainSessionKeyStorage = "main"
|
private var mainSessionKeyStorage = "main"
|
||||||
private let toolResultGrace: TimeInterval = 2.0
|
private let toolResultGrace: TimeInterval = 2.0
|
||||||
|
|
||||||
var mainSessionKey: String { self.mainSessionKeyStorage }
|
var mainSessionKey: String {
|
||||||
|
self.mainSessionKeyStorage
|
||||||
|
}
|
||||||
|
|
||||||
func handleJob(sessionKey: String, state: String) {
|
func handleJob(sessionKey: String, state: String) {
|
||||||
let isStart = state.lowercased() == "started" || state.lowercased() == "streaming"
|
let isStart = state.lowercased() == "started" || state.lowercased() == "streaming"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Network
|
import Network
|
||||||
import Observation
|
import Observation
|
||||||
|
import OpenClawKit
|
||||||
import OSLog
|
import OSLog
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@@ -18,7 +18,10 @@ public final class GatewayDiscoveryModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public struct DiscoveredGateway: Identifiable, Equatable, Sendable {
|
public struct DiscoveredGateway: Identifiable, Equatable, Sendable {
|
||||||
public var id: String { self.stableID }
|
public var id: String {
|
||||||
|
self.stableID
|
||||||
|
}
|
||||||
|
|
||||||
public var displayName: String
|
public var displayName: String
|
||||||
// Resolved service endpoint (SRV + A/AAAA). Used for routing; do not trust TXT for routing.
|
// Resolved service endpoint (SRV + A/AAAA). Used for routing; do not trust TXT for routing.
|
||||||
public var serviceHost: String?
|
public var serviceHost: String?
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawKit
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
|
|
||||||
struct WideAreaGatewayBeacon: Sendable, Equatable {
|
struct WideAreaGatewayBeacon: Sendable, Equatable {
|
||||||
var instanceName: String
|
var instanceName: String
|
||||||
@@ -117,13 +117,12 @@ enum WideAreaGatewayDiscovery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var seen = Set<String>()
|
var seen = Set<String>()
|
||||||
let ordered = ips.filter { value in
|
return ips.filter { value in
|
||||||
guard self.isTailnetIPv4(value) else { return false }
|
guard self.isTailnetIPv4(value) else { return false }
|
||||||
if seen.contains(value) { return false }
|
if seen.contains(value) { return false }
|
||||||
seen.insert(value)
|
seen.insert(value)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return ordered
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static func readTailscaleStatus() -> String? {
|
private static func readTailscaleStatus() -> String? {
|
||||||
@@ -370,5 +369,7 @@ private struct TailscaleStatus: Decodable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Collection {
|
extension Collection {
|
||||||
fileprivate var nonEmpty: Self? { isEmpty ? nil : self }
|
fileprivate var nonEmpty: Self? {
|
||||||
|
isEmpty ? nil : self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -407,11 +407,10 @@ extension Request: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shared transport settings
|
/// Shared transport settings
|
||||||
public let controlSocketPath: String = {
|
public let controlSocketPath: String = {
|
||||||
let home = FileManager().homeDirectoryForCurrentUser
|
let home = FileManager().homeDirectoryForCurrentUser
|
||||||
let preferred = home
|
return home
|
||||||
.appendingPathComponent("Library/Application Support/OpenClaw/control.sock")
|
.appendingPathComponent("Library/Application Support/OpenClaw/control.sock")
|
||||||
.path
|
.path
|
||||||
return preferred
|
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import Foundation
|
||||||
import OpenClawKit
|
import OpenClawKit
|
||||||
import OpenClawProtocol
|
import OpenClawProtocol
|
||||||
import Foundation
|
|
||||||
#if canImport(Darwin)
|
#if canImport(Darwin)
|
||||||
import Darwin
|
import Darwin
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import OpenClawDiscovery
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawDiscovery
|
||||||
|
|
||||||
struct DiscoveryOptions {
|
struct DiscoveryOptions {
|
||||||
var timeoutMs: Int = 2000
|
var timeoutMs: Int = 2000
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import OpenClawKit
|
|
||||||
import OpenClawProtocol
|
|
||||||
import Darwin
|
import Darwin
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import OpenClawKit
|
||||||
|
import OpenClawProtocol
|
||||||
|
|
||||||
struct WizardCliOptions {
|
struct WizardCliOptions {
|
||||||
var url: String?
|
var url: String?
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user