Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

chat-adapter-imessage聊天适配器 immessage

Agent Skill

chat-adapter-imessage 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

588

周安装

25

GitHub Stars

10

下载量

206
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:chat-adapter-imessage(聊天适配器 immessage)
来源仓库:https://github.com/photon-hq/skills
仓库路径:skills/chat-adapter-imessage
安装命令:
npx skills add https://github.com/photon-hq/skills --skill chat-adapter-imessage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/photon-hq/skills --skill chat-adapter-imessage

简介

chat-adapter-imessage 桥接 Vercel AI SDK 与 iMessage,支持在消息应用中部署 AI 助手。

  • 提供本地开发与远程生产两种模式,分别对接自托管与 Photon 基础设施。
  • 核心依赖 @photon-ai/imessage-kit 处理消息收发与线程管理逻辑。
  • 需 macOS 环境与开发者账号权限,普通用户无法直接部署运行。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Vercel AI SDK: iMessage Adapter Skill

This skill provides a complete reference for using chat-adapter-imessage, the official Photon adapter for connecting the Vercel AI SDK (Chat SDK) to iMessage.

Overview

The adapter acts as a bridge, allowing you to build AI agents and assistants with the Vercel AI SDK that communicate with users over iMessage. It leverages @photon-ai/imessage-kit (self-hosted) and @photon-ai/advanced-imessage-kit (production infrastructure by Photon) under the hood.

Key Features

  • Two Modes: Run in local mode on any Mac for development, or remote mode connected to Photon's production iMessage infrastructure.
  • Unified Interface: Provides a consistent API for sending and receiving messages, regardless of the underlying mode.
  • Vercel AI SDK Integration: Implements the Adapter interface from the chat package, making it a drop-in solution.
  • Markdown Conversion: Automatically converts markdown from the AI SDK into iMessage-compatible plain text.

Setup and Initialization

Installation

pnpm install chat-adapter-imessage @photon-ai/imessage-kit
# For remote mode, also install the advanced kit
pnpm install @photon-ai/advanced-imessage-kit

createiMessageAdapter(config)

This is the main entry point. It creates and configures an instance of the iMessageAdapter.

import { createiMessageAdapter } from 'chat-adapter-imessage';

// Local Mode: Runs on your Mac, uses your iMessage
const localAdapter = createiMessageAdapter({ local: true });

// Remote Mode: Connects to Photon's production servers
const remoteAdapter = createiMessageAdapter({
  local: false,
  serverUrl: process.env.IMESSAGE_SERVER_URL, // Provided by Photon
  apiKey: process.env.IMESSAGE_API_KEY      // Provided by Photon
});

Configuration (iMessageAdapterConfig)

ModelocalserverUrlapiKeyDescription
LocaltrueOptionalOptionalRuns on macOS using @photon-ai/imessage-kit. serverUrl and apiKey are ignored.
RemotefalseRequiredRequiredConnects to Photon's infra using @photon-ai/advanced-imessage-kit.

Integrating with Chat

Once created, the adapter is passed to the Chat constructor from the Vercel AI SDK.

import { Chat } from 'chat';
import { createiMessageAdapter } from 'chat-adapter-imessage';

const adapter = createiMessageAdapter({ local: true });

const chat = new Chat({
  adapter,
  // ... your other Chat config
});

Core Adapter Methods

adapter.initialize(chat)

Called by the Chat instance to link the adapter. In remote mode, this method also establishes the WebSocket connection to the Photon server.

adapter.postMessage(threadId, message)

Sends a message to a specific iMessage thread.

  • threadId: The encoded thread identifier, which is the chatGuid (e.g., iMessage;-;+15551234567).
  • message: An AdapterPostableMessage object, which can be a simple string or a FormattedContent object with markdown.
const threadId = 'iMessage;-;+15551234567'; // A direct message thread

// Send a simple text message
await adapter.postMessage(threadId, 'Hello from the adapter!');

// Send a message with markdown (will be converted to plain text)
await adapter.postMessage(threadId, {
  markdown: 'Here are the results:\n\n- **Item 1**\n- *Item 2*'
});

adapter.editMessage(threadId, messageId, message)

Edits a previously sent message. Only supported in remote mode.

await adapter.editMessage(
  'iMessage;-;+15551234567',
  'p:0/GUID-OF-MESSAGE-TO-EDIT',
  'This is the corrected text.'
);

adapter.deleteMessage(threadId, messageId)

Unsends/deletes a previously sent message. Only supported in remote mode.

await adapter.deleteMessage(
  'iMessage;-;+15551234567',
  'p:0/GUID-OF-MESSAGE-TO-DELETE'
);

adapter.react(threadId, messageId, emoji)

Adds a tapback/reaction to a message. Only supported in remote mode.

  • emoji: A standard emoji character or a name like heart, like, laugh.
await adapter.react(
  'iMessage;-;+15551234567',
  'p:0/GUID-OF-MESSAGE-TO-REACT-TO',
  '❤️'
);

adapter.startGatewayListener(options)

This is the primary method for receiving messages. It starts a listener that ingests messages from both local and remote SDKs and forwards them to the Chat instance.

// In your main application file

const adapter = createiMessageAdapter({ local: true });
const chat = new Chat({ adapter });

// Start listening for incoming iMessages
adapter.startGatewayListener();

// Now, messages sent to your iMessage will be processed by the Chat SDK
chat.on('message', (message) => {
  console.log(`[${message.author.userName}]: ${message.text}`);
  // Your AI logic here...
});

adapter.handleWebhook(request)

This method is not supported. The adapter does not use traditional webhooks for message ingestion. You must use startGatewayListener() instead.


Type Reference

iMessageThreadId

The decoded threadId object.

interface iMessageThreadId {
  chatGuid: string; // e.g., "iMessage;-;+1234567890"
}

iMessageGatewayMessageData

The normalized message object that the adapter uses internally.

interface iMessageGatewayMessageData {
  guid: string;
  text: string | null;
  sender: string;
  senderName: string | null;
  chatId: string;
  isGroupChat: boolean;
  isFromMe: boolean;
  date: string; // ISO 8601
  attachments: iMessageAttachment[];
  source: 'local' | 'remote';
  raw?: unknown; // Original message object from the underlying SDK
}

NativeWebhookPayload

If using the Self-Hosted Kit's native webhook feature, this is the shape of the JSON payload that will be sent to your endpoint. The adapter can process this payload.

interface NativeWebhookPayload {
  guid: string;
  text: string | null;
  sender: string;
  chatId: string;
  // ... and other fields from the Basic Kit Message object
}

References

  1. Vercel AI SDK (Chat)
  2. chat-adapter-imessage on npm
  3. Photon

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.68%
按下载量换算69

Claude

31.97%
按下载量换算66

Cursor

20.49%
按下载量换算42

Gemini CLI

8.51%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills