diff options
| author | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 14:51:47 -0700 |
|---|---|---|
| committer | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 14:51:47 -0700 |
| commit | 6d0053f69e717a8d960d8e2e4ba55878473aa2d3 (patch) | |
| tree | 4161dc02f3f924237ece237e4b13eae0d5173bda /external_plugins/imessage/server.ts | |
| parent | 252577f8de4c3f874660b93858972a087716e0b4 (diff) | |
Add IMESSAGE_APPEND_SIGNATURE env var (default true)
Diffstat (limited to 'external_plugins/imessage/server.ts')
| -rw-r--r-- | external_plugins/imessage/server.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/external_plugins/imessage/server.ts b/external_plugins/imessage/server.ts index d208a16c..190a5ce9 100644 --- a/external_plugins/imessage/server.ts +++ b/external_plugins/imessage/server.ts @@ -30,6 +30,8 @@ import { homedir } from 'os' 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 STATE_DIR = join(homedir(), '.claude', 'channels', 'imessage') @@ -550,6 +552,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async req => { const limit = Math.max(1, Math.min(access.textChunkLimit ?? MAX_CHUNK_LIMIT, MAX_CHUNK_LIMIT)) const mode = access.chunkMode ?? 'length' const chunks = chunk(text, limit, mode) + if (APPEND_SIGNATURE && chunks.length > 0) chunks[chunks.length - 1] += SIGNATURE let sent = 0 for (let i = 0; i < chunks.length; i++) { |
