Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ── Personal data — NEVER commit these ───────────────────────────────────────
config/api_keys.json
memory/long_term.json
memory/pending_tasks.json
memory/*.json
.wake_signal

# ── Python ────────────────────────────────────────────────────────────────────
__pycache__/
*.py[cod]
*.pyo
.venv/
*.egg-info/
dist/
build/

# ── macOS ─────────────────────────────────────────────────────────────────────
.DS_Store
.AppleDouble
.LSOverride

# ── Logs / temp ───────────────────────────────────────────────────────────────
*.log
/tmp/
ali_sites/

# ── IDE ───────────────────────────────────────────────────────────────────────
.vscode/
.idea/
*.swp
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
2 changes: 1 addition & 1 deletion actions/computer_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _require_pyautogui():
"Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller",
"Davis", "Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson",
]
_DOMAINS = ["gmail.com", "yahoo.com", "outlook.com", "proton.me", "mail.com"]
_DOMAINS = ["mail.com", "proton.me", "outlook.com", "icloud.com", "yahoo.com"]


def _random_data(data_type: str) -> str:
Expand Down
65 changes: 65 additions & 0 deletions actions/computer_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,60 @@ def open_run():
if _OS == "Windows":
pyautogui.hotkey("win", "r")

def connect_bluetooth(device_name: str = ""):
if _OS == "Darwin":
# Try blueutil first (fastest)
blueutil = subprocess.run(["which", "blueutil"], capture_output=True, text=True).stdout.strip()
if blueutil:
# Find device and connect
result = subprocess.run([blueutil, "--paired", "--format", "json"],
capture_output=True, text=True)
try:
import json as _json
devices = _json.loads(result.stdout)
for dev in devices:
name = dev.get("name", "")
if not device_name or device_name.lower() in name.lower():
addr = dev.get("address", "")
subprocess.run([blueutil, "--connect", addr], capture_output=True)
return f"Connected to {name}."
except Exception:
pass

# Fallback: open Bluetooth settings so user can connect
script = '''
tell application "System Settings"
activate
end tell
delay 0.5
open location "x-apple.systempreferences:com.apple.preferences.Bluetooth"
'''
subprocess.run(["osascript", "-e", script], capture_output=True)
return "Opened Bluetooth settings. Click your AirPods to connect."
else:
return "Bluetooth control is only supported on macOS."

def list_bluetooth_devices():
if _OS == "Darwin":
result = subprocess.run(
["system_profiler", "SPBluetoothDataType", "-json"],
capture_output=True, text=True, timeout=8
)
try:
import json as _json
data = _json.loads(result.stdout)
items = []
bt = data.get("SPBluetoothDataType", [{}])[0]
for key in ("device_connected", "device_not_connected"):
for dev in bt.get(key, []):
for name, info in dev.items():
state = "connected" if key == "device_connected" else "not connected"
items.append(f"{name} ({state})")
return "\n".join(items) if items else "No Bluetooth devices found."
except Exception as e:
return f"Could not list devices: {e}"
return "Not supported on this OS."

def dark_mode():
if _OS == "Darwin":
subprocess.run(["osascript", "-e",
Expand Down Expand Up @@ -561,6 +615,11 @@ def shutdown_computer():
"toggle_wifi": toggle_wifi,
"restart": restart_computer,
"shutdown": shutdown_computer,
"connect_bluetooth": connect_bluetooth,
"connect_airpods": connect_bluetooth,
"bluetooth_connect": connect_bluetooth,
"list_bluetooth": list_bluetooth_devices,
"bluetooth_devices": list_bluetooth_devices,
}

_DANGEROUS_ACTIONS = {"restart", "shutdown"}
Expand Down Expand Up @@ -681,6 +740,12 @@ def computer_settings(
return f"Unknown action: '{raw_action}'."

try:
if action in ("connect_bluetooth", "connect_airpods", "bluetooth_connect"):
device = str(value or params.get("device", "") or params.get("device_name", "")).strip()
result = func(device)
return result or f"Done: {action}."
if action in ("list_bluetooth", "bluetooth_devices"):
return func()
func()
return f"Done: {action}."
except Exception as e:
Expand Down
Loading