codeburn/mac/Sources/CodeBurnRefreshAgent/main.swift
Rashid Razak f5b0ac500f Replace osascript/JXA with native Mach-O agent and SMAppService to fix EDR detection
- Add CodeBurnRefreshAgent target: native fire-and-exit binary posting com.codeburn.refresh notification
- Rewrite installLaunchAgentIfNeeded(): plist ProgramArguments points to native binary, not osascript/JXA
- Rewrite registerLoginItemIfNeeded(): uses SMAppService API instead of osascript/System Events
- Add startSocketListener(): Unix domain socket for CLI-triggered menubar refresh
- Add src/menubar-socket.ts: CLI-side notifyMenubar() helper wired into status --format menubar-json
- Update Package.swift with new product/target, package-app.sh copies agent into bundle Resources
- Add tests: plist content verification, login item guard, agent smoke test
2026-05-11 19:06:08 +08:00

8 lines
187 B
Swift

import Foundation
DistributedNotificationCenter.default().postNotificationName(
.init("com.codeburn.refresh"),
object: nil,
userInfo: nil,
options: .deliverImmediately
)