add-imessage
Add iMessage as an optional channel skill for NanoClaw using a single-file local-macos-first implementation. Phase 1 keeps BlueBubbles as a config seam.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add iMessage as an optional channel skill for NanoClaw using a single-file local-macos-first implementation. Phase 1 keeps BlueBubbles as a config seam.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add new capabilities or modify NanoClaw behavior. Use when user wants to add channels (iMessage, Telegram, Slack, email input), change triggers, add integrations, modify the router, or make any other customizations. This is an interactive skill that asks questions to understand what the user wants.
Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate messaging channels, register their main channel, or start the background services. Triggers on "setup", "install", "configure nanoclaw", or first-time setup requests.
Add Gmail integration to NanoClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.
Add a local Ollama MCP server so the Codex worker can call local models for cheaper/faster summarization, translation, or general helper tasks.
Add Slack as a channel. Can replace WhatsApp entirely or run alongside it. Uses Socket Mode (no public URL needed).
Add Telegram as a channel. Can replace WhatsApp entirely or run alongside it. Also configurable as a control-only channel (triggers actions) or passive channel (receives notifications only).
| name | add-imessage |
| description | Add iMessage as an optional channel skill for NanoClaw using a single-file local-macos-first implementation. Phase 1 keeps BlueBubbles as a config seam. |
This skill adds optional iMessage support to NanoClaw-Codex. It follows the same skills-engine pattern as add-slack: the code lives in this skill package, is applied deterministically, self-registers through registerChannel('imessage', ...), and does not become a core-bundled channel unless the skill is applied.
Applying the skill with the standard skills engine:
npx tsx scripts/apply-skill.ts .claude/skills/add-imessage
will deterministically:
src/channels/imessage.ts with the complete imessage channel implementationlocal-macos; bluebubbles remains a config seam and logs not-implementedimport './imessage.js'; to src/channels/index.tssrc/channels/imessage.test.ts for channel behavior and compatibility checks.env.example:
IMESSAGE_ENABLEDIMESSAGE_BACKENDIMESSAGE_POLL_INTERVAL_MSIMESSAGE_DB_PATH.nanoclaw/state.yamlIf the apply reports merge conflicts, read:
modify/src/channels/index.ts.intent.mdsrc/channels/imessage.tssrc/channels/imessage.test.tsimessageimessage:<stable-chat-id>ownsJid() behavioronMessageonChatMetadataThis skill currently requires:
~/Library/Messages/chat.db)osascript / AppleScript to control Messages.app for outbound sendschat.db)iMessage has no bot token flow, so "auth complete" means all local macOS permissions are complete:
SQLITE_CANTOPEN / authorization denied)imessage:<stable-chat-id>IMESSAGE_ENABLED=true, backend set to local-macos)Add these values to .env:
IMESSAGE_ENABLED=true
IMESSAGE_BACKEND=local-macos
IMESSAGE_POLL_INTERVAL_MS=1500
IMESSAGE_DB_PATH=~/Library/Messages/chat.db
IMESSAGE_ALLOWED_CONTACTS=+15551234567,user@example.com
The current local-worker runtime reads .env from the host directly; there is no data/env/env sync step.
If you want iMessage enabled only for one group, prefer a group-scoped groups.<folder>.env override in ~/.config/nanoclaw/group-secrets.json instead of a global .env toggle.
Example:
{
"version": 1,
"groups": {
"main": {
"env": {
"IMESSAGE_ENABLED": "true",
"IMESSAGE_BACKEND": "local-macos"
}
}
}
}
The host resolves those keys into the worker's workerEnv for the matching group.
IMESSAGE_ENABLED is not true, the factory returns nullbluebubbles, startup skips the channel and logs a clear not implemented yet messageIMESSAGE_DB_PATH is missing, startup skips the channel and logs a clear warningIMESSAGE_DB_PATH points to a missing file, startup skips the channel and logs a clear warningIMESSAGE_ALLOWED_CONTACTS controls inbound allowlist semantics:
* = allow all inbound (temporary verification only)allowlist -> registered jid -> metadata/message dispatchOlder runtime builds could produce a duplicate visible follow-up in this pattern:
nanoclaw/send_message (immediate user-visible send)已回复。Current fix is protocol-level (not phrase-based):
nanoclaw/send_message tool calls from Codex stream eventsImplementation reference:
container/agent-runner/src/runtime/codex-runtime.tsRun:
npx vitest run src/channels/imessage.test.ts
npm run build
Then restart and verify:
launchctl kickstart -k gui/$(id -u)/com.nanoclaw
For duplicate-send verification, send a test iMessage and confirm:
mcp tool completed: nanoclaw/send_messageAfter the skill is applied and enabled, register chats using:
imessage:<stable-chat-id>
Examples:
imessage:dm:+15551234567imessage:chat:chat1234567890The exact stable ID comes from the normalization layer so that the outward JID stays backend-agnostic.
When adding BlueBubbles later, implement transport behavior in the
IMESSAGE_BACKEND=bluebubbles branch of src/channels/imessage.ts without
changing the imessage: JID contract or host registration flow.
IMESSAGE_SETUP.md — operator/setup notes for local macOS permissions and validation