Skip to content

feat: add native macOS iMessage channel - #183

Merged
xmanrui merged 2 commits into
xmanrui:mainfrom
cherryFloris:feat/imessage-channel
Sep 9, 2026
Merged

feat: add native macOS iMessage channel#183
xmanrui merged 2 commits into
xmanrui:mainfrom
cherryFloris:feat/imessage-channel

Conversation

@cherryFloris

Copy link
Copy Markdown

Summary

Implements the iMessage channel requested in #137, using macOS Messages.app
directly as the transport; no BlueBubbles or third-party gateway required.

Included

  • Receive / send text messages over the native Messages.app transport
    (~/Library/Messages/chat.db for receive, /usr/bin/osascript for send)
  • Follows the existing channel adapter and runtime architecture; iMessage bot,
    workspace, contact mapping, and Harness sessions stay isolated
  • One iMessage identity per macOS user account, each contact mapped to an
    independent Harness session
  • Host registration and management RPC support (/api/dsh-im/imessage)
  • iMessage settings UI with local permission checks; Full Disk Access and
    Automation permission guidance
  • Credentials, permissions, cursors, and runtime state stored locally on the
    Host; no sensitive data returned through browser-facing RPC
  • Delivery adapter and proactive text delivery support
  • iMessage session title prefixes and session list logos
  • Docs for installation, permissions, testing, security boundaries, and
    limitations

MVP scope (as outlined in #137)

  • Text message receive / send
  • Direct / private conversations
  • Independent Harness session per contact
  • Native macOS Messages.app transport

Intentionally out of scope (first release)

Group chats, images, files/attachments, rich text, quoted replies, reactions,
message edit/recall, multiple Messages.app accounts, and remote
BlueBubbles-style operation.

Permissions and security

Users must explicitly grant:

  1. Full Disk Access to the terminal / app running DeepSeek Harness
  2. Automation permission to control Messages.app

chat.db is only read via read-only queries; messages are sent only through
the native Messages.app automation interface.

Compatibility notes

  • macOS-specific; chat.db is an internal database rather than a stable public
    API, so future macOS releases may require compatibility updates
  • For testing use a separate iMessage address; self-chat may cause message
    loops or duplicate replies

Testing

  • npm run check passes
  • 2590 automated tests passed
  • Package artifact verification passed
  • Session channel logo browser verification passed

Manual flow:

  1. Sign in to iMessage in Messages.app
  2. Grant Full Disk Access and Automation permissions
  3. Enable iMessage in the dsh-im settings page
  4. Send a text from another phone number / Apple ID
  5. Verify Harness receives the message and replies via Messages.app
  6. Verify the session is labeled with the iMessage channel identity

cherry added 2 commits September 9, 2026 11:33
Make the latest-row-id test exercise the mocked sqlite path on any OS.
getLatestMessageRowId short-circuits to 0 on non-darwin, which failed the
assert (0 !== 744) on the Linux CI runner. Mock process.platform to darwin
and restore it via t.after().
@xmanrui
xmanrui merged commit 3febdcd into xmanrui:main Sep 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants