feat(mac): add automation permission

This commit is contained in:
Peter Steinberger
2025-12-07 02:34:21 +01:00
parent 2e67c5a045
commit ea37ee6cb3
4 changed files with 10 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ struct PermissionRow: View {
private var title: String { private var title: String {
switch self.capability { switch self.capability {
case .appleScript: "Automation (AppleScript)"
case .notifications: "Notifications" case .notifications: "Notifications"
case .accessibility: "Accessibility" case .accessibility: "Accessibility"
case .screenRecording: "Screen Recording" case .screenRecording: "Screen Recording"
@@ -89,6 +90,8 @@ struct PermissionRow: View {
private var subtitle: String { private var subtitle: String {
switch self.capability { switch self.capability {
case .appleScript:
"Control other apps (e.g. Terminal) for automation actions"
case .notifications: "Show desktop alerts for agent activity" case .notifications: "Show desktop alerts for agent activity"
case .accessibility: "Control UI elements when an action requires it" case .accessibility: "Control UI elements when an action requires it"
case .screenRecording: "Capture the screen for context or screenshots" case .screenRecording: "Capture the screen for context or screenshots"
@@ -99,6 +102,7 @@ struct PermissionRow: View {
private var icon: String { private var icon: String {
switch self.capability { switch self.capability {
case .appleScript: "applescript"
case .notifications: "bell" case .notifications: "bell"
case .accessibility: "hand.raised" case .accessibility: "hand.raised"
case .screenRecording: "display" case .screenRecording: "display"

View File

@@ -3,6 +3,8 @@ import Foundation
// MARK: - Capabilities // MARK: - Capabilities
public enum Capability: String, Codable, CaseIterable, Sendable { public enum Capability: String, Codable, CaseIterable, Sendable {
/// AppleScript / Automation access to control other apps (TCC Automation).
case appleScript
case notifications case notifications
case accessibility case accessibility
case screenRecording case screenRecording

View File

@@ -5,7 +5,7 @@ Author: steipete · Status: draft spec · Date: 2025-12-05
## Purpose ## Purpose
- Single macOS menu-bar app named **Clawdis** that: - Single macOS menu-bar app named **Clawdis** that:
- Shows native notifications for Clawdis/warelay events. - Shows native notifications for Clawdis/warelay events.
- Owns TCC prompts (Notifications, Accessibility, Screen Recording). - Owns TCC prompts (Notifications, Accessibility, Screen Recording, Automation/AppleScript, Microphone, Speech Recognition).
- Brokers privileged actions (screen capture, shell with elevated UI context) via XPC. - Brokers privileged actions (screen capture, shell with elevated UI context) via XPC.
- Provides a tiny CLI (`clawdis-mac`) that talks to the app; Node/TS shells out to it. - Provides a tiny CLI (`clawdis-mac`) that talks to the app; Node/TS shells out to it.
- Replace the separate notifier helper pattern (Oracle) with a built-in notifier. - Replace the separate notifier helper pattern (Oracle) with a built-in notifier.
@@ -26,7 +26,7 @@ Author: steipete · Status: draft spec · Date: 2025-12-05
- Codable enums; small payloads (<1 MB enforced in listener): - Codable enums; small payloads (<1 MB enforced in listener):
``` ```
enum Capability { notifications, accessibility, screenRecording } enum Capability { notifications, accessibility, screenRecording, appleScript, microphone, speechRecognition }
enum Request { enum Request {
notify(title, body, sound?) notify(title, body, sound?)
ensurePermissions([Capability], interactive: Bool) ensurePermissions([Capability], interactive: Bool)

View File

@@ -63,6 +63,8 @@ cat > "$APP_ROOT/Contents/Info.plist" <<PLIST
<string>Clawdis needs the mic for Voice Wake tests and agent audio capture.</string> <string>Clawdis needs the mic for Voice Wake tests and agent audio capture.</string>
<key>NSSpeechRecognitionUsageDescription</key> <key>NSSpeechRecognitionUsageDescription</key>
<string>Clawdis uses speech recognition to detect your Voice Wake trigger phrase.</string> <string>Clawdis uses speech recognition to detect your Voice Wake trigger phrase.</string>
<key>NSAppleEventsUsageDescription</key>
<string>Clawdis needs Automation (AppleScript) permission to drive Terminal and other apps for agent actions.</string>
</dict> </dict>
</plist> </plist>
PLIST PLIST