imessage_daemon
imessage_daemon
¶
iMessage daemon — polls chat.db and routes to DeepResearchAgent.
Monitors a designated iMessage conversation for new messages, routes them to the agent, and sends responses back via AppleScript.
Requires macOS with Full Disk Access for chat.db reading and Accessibility permission for AppleScript Messages control.
Functions¶
poll_new_messages
¶
poll_new_messages(*, db_path: str = _DEFAULT_DB_PATH, last_rowid: int = 0, chat_identifier: str = '') -> List[Dict[str, Any]]
Return new incoming messages since last_rowid.
Source code in src/openjarvis/channels/imessage_daemon.py
send_imessage
¶
Send an iMessage via AppleScript.
chat_identifier is the recipient handle:
- phone number in E.164 format (e.g. +15551234567)
- or email address registered with iMessage
Internally addresses the recipient via the iMessage service's
participant lookup — the previous chat id "..." form
expected an internal chat handle (e.g. iMessage;-;+1555...)
and silently failed on raw phone numbers, returning success while
no message was actually sent.
Source code in src/openjarvis/channels/imessage_daemon.py
run_daemon
¶
run_daemon(*, chat_identifier: str, db_path: str = _DEFAULT_DB_PATH, handler: Any = None, poll_interval: float = _POLL_INTERVAL, max_iterations: int = 0) -> None
Run the iMessage polling daemon.
Source code in src/openjarvis/channels/imessage_daemon.py
is_running
¶
Check if the daemon is currently running.
Source code in src/openjarvis/channels/imessage_daemon.py
stop_daemon
¶
Stop the running daemon. Returns True if stopped.