summaryrefslogtreecommitdiff
path: root/external_plugins/imessage
AgeCommit message (Collapse)Author
2026-09-30imessage: surface every inbound image, not just the firstdltn/imessage-multi-imagedltn
An iMessage with several photos arrived with only the first one in the channel tag: handleInbound took the first image attachment and stopped. Collect every image attachment instead (same filters as before) and pass each path in the notification meta as image_path, image_path_2, image_path_3, ... so the model can Read all of them. A single image still produces exactly image_path, so existing behaviour is unchanged. Numbered keys rather than an array or a joined list: Claude Code accepts only string values in channel meta and renders each key as an attribute on the <channel> tag, so keys must be plain identifiers; one key per path also avoids inventing a delimiter for sender-controlled filenames. The attachments query gains ORDER BY a.ROWID so the numbering follows attachment ROWID (creation) order. Instructions and README updated to match; version 0.1.0 -> 0.2.0 in plugin.json and package.json. Known limits, unchanged by this patch: attachments still downloading when the message row is first polled (filename NULL) are skipped and, since the poll watermark has already passed the message, never picked up later; HEIC is passed through unconverted; attachments with a NULL mime_type still pass the image filter; no cap on images per message.
2026-03-30Merge pull request #1055 from ↵Kenneth Lien
anthropics/kenneth/imessage-permission-selfchat-only imessage: restrict permission relay to self-chat, fix echo filter & tapback noise
2026-03-27feat(imessage): add IMESSAGE_DB_PATH env var for testingrussell/imessage-conversational-formatRussell Coleman
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.
2026-03-26imessage: bump to 0.1.0kenneth/imessage-permission-selfchat-onlyKenneth Lien
2026-03-26imessage: drop SMS/RCS by default, opt-in via IMESSAGE_ALLOW_SMSKenneth Lien
SMS sender IDs are spoofable; iMessage is Apple-ID-authenticated and end-to-end encrypted. The plugin previously treated both identically, so a forged SMS from the owner's own number would match SELF, bypass the access gate, and inherit owner-level trust — including permission approval. handleInbound now drops anything with service != 'iMessage' unless IMESSAGE_ALLOW_SMS=true. Default is the safe path; users who want SMS can opt in after reading the warning in README.
2026-03-26imessage: trim comment cruftKenneth Lien
2026-03-26imessage: harden echo filter normalizationKenneth Lien
The self-chat echo filter matches outbound text against what chat.db stores on round-trip. Three divergence sources caused false negatives and duplicate bubbles: - Signature suffix: "\nSent by Claude" is appended on send, but the \n may not round-trip identically through attributedBody - Emoji variation selectors (U+FE00-FE0F) and ZWJ (U+200D): chat.db can add or drop these on emoji characters - Smart quotes: macOS auto-substitutes straight quotes on the way in Strip/normalize all three in echoKey() before the existing whitespace collapse. Fixes #1024
2026-03-26imessage: drop whitespace-only messages from tapbacks/receiptsKenneth Lien
Tapback reactions and read receipts synced from linked devices arrive as chat.db rows with whitespace-only text. The existing empty-check used falsy comparison which doesn't catch ' ' or invisible chars, causing unsolicited replies to reaction taps. Fixes #1041
2026-03-26imessage: restrict permission relay to self-chat onlyKenneth Lien
Permission prompts were being broadcast to all allowlisted contacts plus every DM resolvable from the SELF address set. Two compounding bugs: 1. SELF was polluted by chat.last_addressed_handle, which on machines with SMS history returns short codes, business handles, and other contacts' numbers — not just the owner's addresses. One reporter's query returned 50 addresses (2 actually theirs) resolving to 148 DM chats, all of which received permission prompts. 2. Even with a clean SELF, the handler sent to allowFrom + SELF, so every allowlisted contact received the prompt and could reply to approve tool execution on the owner's machine. Fix: - Build SELF from message.account WHERE is_from_me=1 only - Send permission prompts to self-chat only, not allowFrom - Accept permission replies from self-chat only Fixes #1048 Fixes #1010
2026-03-25feat(imessage): conversational format for chat_messagesRussell Coleman
Reformat chat_messages output from flat per-message lines to grouped conversation threads. Each thread gets a header labelling it DM or Group with its participant list, date-separator lines when the calendar day rolls over, and [HH:MM] local-time stamps instead of full ISO. chat_guid is now optional — omit to dump every allowlisted chat at once for a quick multi-thread overview. Default limit raised 20→100 per chat, capped at 500. New queries: qChatParticipants (handle list per chat) and qChatInfo (display_name + style to distinguish DM/group). renderMsg replaced by conversationHeader + renderConversation.
2026-03-23Regenerate imessage bun.lock without artifactory URLskenneth/fix-imessage-lockfileKenneth Lien
The lockfile had 94 artifactory.infra.ant.dev URLs baked in from generation behind a private registry. External users hit 401s on 'bun install' and the server never starts. Regenerated against registry.npmjs.org to match the .npmrc.
2026-03-23Show input_preview only for Bash in permission promptsadd-imessage-channelKenneth Lien
Write/Edit previews are unbearably long over iMessage. Bash is the dangerous one where seeing the command matters; everything else gets tool_name + description only.
2026-03-23Document IMESSAGE_STATE_DIR in READMEKenneth Lien
2026-03-23feat(imessage): port permission-relay + lifecycle fixes from telegramKenneth Lien
Brings the imessage channel to parity with recent telegram/discord hardening: - Permission-relay capability: declare claude/channel/permission, handle inbound permission_request notifications by fanning out to allowlisted DM chats + self-chat, intercept "yes/no <id>" replies after the gate check and emit structured permission events instead of relaying as chat. Groups excluded per single-user-mode policy. - Global unhandledRejection/uncaughtException handlers so the server logs instead of dying silently. - IMESSAGE_STATE_DIR env override for the state directory. - .unref() on both setInterval timers so they don't block shutdown. - stdin EOF / SIGTERM / SIGINT shutdown handler that closes chat.db and exits cleanly instead of leaving a zombie poll loop. Adds zod as a direct dep (already transitively present via the MCP SDK) for the notification handler schema.
2026-03-20Add IMESSAGE_APPEND_SIGNATURE env var (default true)Kenneth Lien
2026-03-18Add imessage channel pluginKenneth Lien
iMessage bridge for Claude Code. Reads ~/Library/Messages/chat.db directly for history and new-message polling; sends via AppleScript to Messages.app. macOS only. Built-in access control: inbound messages are gated by an allowlist (default: self-chat only), outbound sends are scoped to the same allowlist. The /imessage:access skill manages allowlists and policy. Requires Full Disk Access and Automation TCC grants — both prompted by macOS on first use. Ships full source — server.ts runs locally via bun, started by the .mcp.json command.