mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
- ensureRuntimeFiles() 改为始终同步源文件而非仅缺失时复制 - pre-authorized apps 增加 tier: 'full',与现有 allowedApps 合并而非替换 - normalizeOsPermissions() 将 screenRecording: null 视为非阻塞 - config 路径改为 cc-haha/computer-use-config.json - mac_helper.py 改进鼠标点击与坐标处理
26 lines
745 B
TypeScript
26 lines
745 B
TypeScript
export type RawOsPermissions = {
|
|
accessibility: boolean
|
|
screenRecording: boolean | null
|
|
}
|
|
|
|
export type NormalizedOsPermissions = {
|
|
granted: boolean
|
|
accessibility: boolean
|
|
screenRecording: boolean
|
|
}
|
|
|
|
/**
|
|
* macOS Screen Recording passive probes can come back "unknown" for helper
|
|
* child processes even when the app bundle is already authorized. Treat that
|
|
* state as non-blocking and let the actual capture path remain the final
|
|
* source of truth.
|
|
*/
|
|
export function normalizeOsPermissions(perms: RawOsPermissions): NormalizedOsPermissions {
|
|
const screenRecording = perms.screenRecording !== false
|
|
return {
|
|
granted: perms.accessibility && screenRecording,
|
|
accessibility: perms.accessibility,
|
|
screenRecording,
|
|
}
|
|
}
|