Jelajahi Sumber

feat(imessage): add IMESSAGE_DB_PATH env var for testing

Mirrors the existing IMESSAGE_STATE_DIR override. Lets a mock sqlite
chat.db stand in for ~/Library/Messages/chat.db so chat_messages can be
tested without macOS + Full Disk Access + real iMessage history.
Russell Coleman 5 bulan lalu
induk
melakukan
a1ffbcc771
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      external_plugins/imessage/server.ts

+ 2 - 1
external_plugins/imessage/server.ts

@@ -33,7 +33,8 @@ import { join, basename, sep } from 'path'
 const STATIC = process.env.IMESSAGE_ACCESS_MODE === 'static'
 const APPEND_SIGNATURE = process.env.IMESSAGE_APPEND_SIGNATURE !== 'false'
 const SIGNATURE = '\nSent by Claude'
-const CHAT_DB = join(homedir(), 'Library', 'Messages', 'chat.db')
+const CHAT_DB =
+  process.env.IMESSAGE_DB_PATH ?? join(homedir(), 'Library', 'Messages', 'chat.db')
 
 const STATE_DIR = process.env.IMESSAGE_STATE_DIR ?? join(homedir(), '.claude', 'channels', 'imessage')
 const ACCESS_FILE = join(STATE_DIR, 'access.json')