cc-haha/src/utils/computerUse/permissions.ts
程序员阿江(Relakkes) 166fe5b676 fix: Computer Use 点击功能修复
- ensureRuntimeFiles() 改为始终同步源文件而非仅缺失时复制
- pre-authorized apps 增加 tier: 'full',与现有 allowedApps 合并而非替换
- normalizeOsPermissions() 将 screenRecording: null 视为非阻塞
- config 路径改为 cc-haha/computer-use-config.json
- mac_helper.py 改进鼠标点击与坐标处理
2026-04-15 14:18:37 +08:00

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,
}
}