#!/bin/sh # 게이트웨이 node 의 FDA 승인 상태 점검. homebrew node 업그레이드로 경로가 바뀌면 # 기존 승인이 무효화돼 에이전트 세션에서 imsg 가 chat.db 를 못 읽는다. NODE=$(lsof -p "$(pgrep -f 'openclaw/dist/index.js gateway')" -a -d txt 2>/dev/null | awk 'NR==2{print $NF}') [ -z "$NODE" ] && { echo "❌ 게이트웨이 프로세스를 못 찾음"; exit 1; } echo "게이트웨이 node: $NODE" /usr/bin/python3 -c " import sqlite3,sys c=sqlite3.connect('file:/Library/Application Support/com.apple.TCC/TCC.db?mode=ro',uri=True) r=c.execute(\"select auth_value from access where service='kTCCServiceSystemPolicyAllFiles' and client=?\",('$NODE',)).fetchone() if r and r[0]==2: print('FDA: ✅ 허용') else: print('FDA: ❌', '거부' if r else '미등록') print(' → 시스템 설정 > 개인정보 보호 및 보안 > 전체 디스크 접근 권한 에 위 경로 추가 후') print(' → launchctl kickstart -k gui/\$(id -u)/ai.openclaw.gateway') sys.exit(1) "