@elizaos/plugin-imessage 2.0.0-beta.1 → 2.0.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -18
- package/auto-enable.ts +1 -1
- package/dist/accounts.d.ts +2 -2
- package/dist/accounts.js +3 -3
- package/dist/accounts.js.map +1 -1
- package/dist/api/bluebubbles-routes.d.ts +1 -1
- package/dist/api/bluebubbles-routes.d.ts.map +1 -1
- package/dist/api/imessage-routes.d.ts +9 -21
- package/dist/api/imessage-routes.d.ts.map +1 -1
- package/dist/api/imessage-routes.js +5 -7
- package/dist/api/imessage-routes.js.map +1 -1
- package/dist/chatdb-reader.d.ts +1 -1
- package/dist/chatdb-reader.d.ts.map +1 -1
- package/dist/chatdb-reader.js +21 -1
- package/dist/chatdb-reader.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/connector-account-provider.d.ts +1 -1
- package/dist/connector-account-provider.js +5 -5
- package/dist/connector-account-provider.js.map +1 -1
- package/dist/contacts-reader.d.ts +23 -29
- package/dist/contacts-reader.d.ts.map +1 -1
- package/dist/contacts-reader.js +250 -372
- package/dist/contacts-reader.js.map +1 -1
- package/dist/data-routes.d.ts +21 -0
- package/dist/data-routes.d.ts.map +1 -0
- package/dist/data-routes.js +280 -0
- package/dist/data-routes.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/rpc.js +5 -5
- package/dist/rpc.js.map +1 -1
- package/dist/service.d.ts +20 -22
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +65 -54
- package/dist/service.js.map +1 -1
- package/dist/setup-routes.d.ts +15 -27
- package/dist/setup-routes.d.ts.map +1 -1
- package/dist/setup-routes.js +101 -284
- package/dist/setup-routes.js.map +1 -1
- package/package.json +22 -4
- package/registry-entry.json +103 -0
package/dist/setup-routes.js
CHANGED
|
@@ -1,321 +1,138 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* iMessage connector
|
|
2
|
+
* iMessage connector setup routes.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* can read and write against macOS Messages.app without each client going
|
|
7
|
-
* straight to chat.db or AppleScript.
|
|
4
|
+
* Implements the shared setup contract defined in
|
|
5
|
+
* `@elizaos/app-core/api/setup-contract.ts`:
|
|
8
6
|
*
|
|
9
|
-
*
|
|
7
|
+
* GET /api/setup/imessage/status service health + connection state
|
|
8
|
+
* POST /api/setup/imessage/start mark iMessage as enabled in connector config
|
|
9
|
+
* POST /api/setup/imessage/cancel clear stored iMessage connector config
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* POST /api/imessage/contacts create a new contact
|
|
17
|
-
* PATCH /api/imessage/contacts/:id update an existing contact
|
|
18
|
-
* DELETE /api/imessage/contacts/:id delete a contact
|
|
11
|
+
* iMessage on macOS does not have a credential/pairing flow — it reads chat.db
|
|
12
|
+
* directly and sends through Messages.app via osascript. "Setup" is just the
|
|
13
|
+
* permission gate (Full Disk Access) plus marking the connector enabled in
|
|
14
|
+
* config so the service spins up. The status endpoint exposes the permission
|
|
15
|
+
* state so the UI can guide the user.
|
|
19
16
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* service
|
|
23
|
-
* the UI can render an informative empty state.
|
|
17
|
+
* Post-setup data routes (messages, chats, contacts) live in
|
|
18
|
+
* `./data-routes.ts` under `/api/imessage/` since they are CRUD against a
|
|
19
|
+
* working service, not part of the pairing/setup state machine.
|
|
24
20
|
*
|
|
25
21
|
* These routes are registered with `rawPath: true` so they mount at their
|
|
26
|
-
*
|
|
22
|
+
* canonical paths without the plugin-name prefix.
|
|
27
23
|
*/
|
|
24
|
+
function setupError(code, message) {
|
|
25
|
+
return { error: { code, message } };
|
|
26
|
+
}
|
|
28
27
|
const IMESSAGE_SERVICE_NAME = "imessage";
|
|
28
|
+
function isConnectorSetupService(service) {
|
|
29
|
+
if (!service || typeof service !== "object")
|
|
30
|
+
return false;
|
|
31
|
+
const candidate = service;
|
|
32
|
+
return typeof candidate.getConfig === "function" && typeof candidate.updateConfig === "function";
|
|
33
|
+
}
|
|
34
|
+
function getSetupService(runtime) {
|
|
35
|
+
const service = runtime.getService("connector-setup");
|
|
36
|
+
return isConnectorSetupService(service) ? service : null;
|
|
37
|
+
}
|
|
29
38
|
function resolveService(runtime) {
|
|
30
39
|
const raw = runtime.getService(IMESSAGE_SERVICE_NAME);
|
|
31
40
|
return raw ?? null;
|
|
32
41
|
}
|
|
33
|
-
|
|
34
|
-
* Extract the `:id` segment from a contact path like
|
|
35
|
-
* `/api/imessage/contacts/ABCD-EFGH-...`. Returns null if the path
|
|
36
|
-
* doesn't match.
|
|
37
|
-
*/
|
|
38
|
-
function parseContactId(pathname) {
|
|
39
|
-
const prefix = "/api/imessage/contacts/";
|
|
40
|
-
if (!pathname.startsWith(prefix))
|
|
41
|
-
return null;
|
|
42
|
-
const rest = pathname.slice(prefix.length);
|
|
43
|
-
if (!rest)
|
|
44
|
-
return null;
|
|
45
|
-
return decodeURIComponent(rest);
|
|
46
|
-
}
|
|
47
|
-
// ── GET /api/imessage/status ────────────────────────────────────────
|
|
48
|
-
async function handleStatus(_req, res, runtime) {
|
|
49
|
-
const service = resolveService(runtime);
|
|
50
|
-
if (!service) {
|
|
51
|
-
res.status(200).json({
|
|
52
|
-
available: false,
|
|
53
|
-
reason: "imessage service not registered",
|
|
54
|
-
});
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
res.status(200).json({
|
|
58
|
-
available: true,
|
|
59
|
-
connected: service.isConnected(),
|
|
60
|
-
...(service.getStatus?.() ?? {}),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
// ── GET /api/imessage/messages?limit=N ──────────────────────────────
|
|
64
|
-
async function handleMessages(req, res, runtime) {
|
|
65
|
-
const service = resolveService(runtime);
|
|
66
|
-
if (!service) {
|
|
67
|
-
res.status(503).json({ error: "imessage service not registered" });
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const url = new URL(req.url ?? "/api/imessage/messages", "http://localhost");
|
|
71
|
-
const limitParam = url.searchParams.get("limit");
|
|
72
|
-
const limit = Math.min(Math.max(1, Number.parseInt(limitParam ?? "50", 10) || 50), 500);
|
|
73
|
-
const chatId = url.searchParams.get("chatId")?.trim() || undefined;
|
|
74
|
-
try {
|
|
75
|
-
const messages = typeof service.getMessages === "function"
|
|
76
|
-
? await service.getMessages({ chatId, limit })
|
|
77
|
-
: await service.getRecentMessages(limit);
|
|
78
|
-
res.status(200).json({ messages, count: messages.length });
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
res.status(500).json({
|
|
82
|
-
error: `failed to read messages: ${error instanceof Error ? error.message : String(error)}`,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// ── POST /api/imessage/messages ────────────────────────────────────
|
|
87
|
-
async function handleSendMessage(req, res, runtime) {
|
|
88
|
-
const service = resolveService(runtime);
|
|
89
|
-
if (!service) {
|
|
90
|
-
res.status(503).json({ error: "imessage service not registered" });
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const body = req.body ?? {};
|
|
94
|
-
const to = body.to?.trim() || "";
|
|
95
|
-
const chatId = body.chatId?.trim() || "";
|
|
96
|
-
const text = body.text?.trim() || "";
|
|
97
|
-
const mediaUrl = body.mediaUrl?.trim() || undefined;
|
|
98
|
-
if (!to && !chatId) {
|
|
99
|
-
res.status(400).json({
|
|
100
|
-
error: "either to or chatId is required",
|
|
101
|
-
});
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (!text && !mediaUrl) {
|
|
105
|
-
res.status(400).json({
|
|
106
|
-
error: "either text or mediaUrl is required",
|
|
107
|
-
});
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
try {
|
|
111
|
-
const result = await service.sendMessage(chatId ? `chat_id:${chatId}` : to, text, {
|
|
112
|
-
...(mediaUrl ? { mediaUrl } : {}),
|
|
113
|
-
...(typeof body.maxBytes === "number" ? { maxBytes: body.maxBytes } : {}),
|
|
114
|
-
});
|
|
115
|
-
if (!result.success) {
|
|
116
|
-
res.status(500).json({
|
|
117
|
-
error: result.error ?? "failed to send iMessage",
|
|
118
|
-
});
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
res.status(200).json(result);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
res.status(500).json({
|
|
125
|
-
error: `sendMessage threw: ${error instanceof Error ? error.message : String(error)}`,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// ── GET /api/imessage/chats ─────────────────────────────────────────
|
|
130
|
-
async function handleChats(_req, res, runtime) {
|
|
42
|
+
function buildStatusResponse(runtime) {
|
|
131
43
|
const service = resolveService(runtime);
|
|
132
44
|
if (!service) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
45
|
+
return {
|
|
46
|
+
connector: "imessage",
|
|
47
|
+
state: "idle",
|
|
48
|
+
detail: {
|
|
49
|
+
available: false,
|
|
50
|
+
connected: false,
|
|
51
|
+
reason: "imessage service not registered",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const connected = service.isConnected();
|
|
56
|
+
const status = service.getStatus?.();
|
|
57
|
+
const state = connected ? "paired" : status?.available ? "configuring" : "idle";
|
|
58
|
+
return {
|
|
59
|
+
connector: "imessage",
|
|
60
|
+
state,
|
|
61
|
+
detail: {
|
|
62
|
+
available: status?.available ?? true,
|
|
63
|
+
connected,
|
|
64
|
+
...(status
|
|
65
|
+
? {
|
|
66
|
+
chatDbAvailable: status.chatDbAvailable,
|
|
67
|
+
sendOnly: status.sendOnly,
|
|
68
|
+
chatDbPath: status.chatDbPath,
|
|
69
|
+
reason: status.reason,
|
|
70
|
+
permissionAction: status.permissionAction,
|
|
71
|
+
}
|
|
72
|
+
: {}),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
145
75
|
}
|
|
146
|
-
// ── GET /api/imessage/
|
|
147
|
-
async function
|
|
148
|
-
|
|
149
|
-
if (!service) {
|
|
150
|
-
res.status(503).json({ error: "imessage service not registered" });
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
try {
|
|
154
|
-
const contacts = await service.listAllContacts();
|
|
155
|
-
res.status(200).json({ contacts, count: contacts.length });
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
res.status(500).json({
|
|
159
|
-
error: `failed to read contacts: ${error instanceof Error ? error.message : String(error)}`,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
76
|
+
// ── GET /api/setup/imessage/status ──────────────────────────────────
|
|
77
|
+
async function handleSetupStatus(_req, res, runtime) {
|
|
78
|
+
res.status(200).json(buildStatusResponse(runtime));
|
|
162
79
|
}
|
|
163
|
-
// ── POST /api/imessage/
|
|
164
|
-
async function
|
|
165
|
-
const
|
|
166
|
-
if (!
|
|
167
|
-
res
|
|
80
|
+
// ── POST /api/setup/imessage/start ──────────────────────────────────
|
|
81
|
+
async function handleSetupStart(_req, res, runtime) {
|
|
82
|
+
const setupService = getSetupService(runtime);
|
|
83
|
+
if (!setupService) {
|
|
84
|
+
res
|
|
85
|
+
.status(503)
|
|
86
|
+
.json(setupError("service_unavailable", "connector-setup service not registered"));
|
|
168
87
|
return;
|
|
169
88
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
phones: body.phones,
|
|
182
|
-
emails: body.emails,
|
|
183
|
-
});
|
|
184
|
-
if (!id) {
|
|
185
|
-
res.status(500).json({
|
|
186
|
-
error: "contact creation failed — see server logs. Common cause: Contacts write permission not granted yet.",
|
|
187
|
-
});
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
res.status(201).json({ id, created: true });
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
res.status(500).json({
|
|
194
|
-
error: `addContact threw: ${error instanceof Error ? error.message : String(error)}`,
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
// ── PATCH /api/imessage/contacts/:id ────────────────────────────────
|
|
199
|
-
async function handleUpdateContact(req, res, runtime) {
|
|
200
|
-
const pathname = req.url ?? "";
|
|
201
|
-
const id = parseContactId(pathname.split("?")[0]);
|
|
202
|
-
if (!id) {
|
|
203
|
-
res.status(400).json({ error: "contact id is required in the path" });
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const service = resolveService(runtime);
|
|
207
|
-
if (!service) {
|
|
208
|
-
res.status(503).json({ error: "imessage service not registered" });
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
const body = req.body ?? {};
|
|
212
|
-
try {
|
|
213
|
-
const ok = await service.updateContact(id, {
|
|
214
|
-
firstName: body.firstName,
|
|
215
|
-
lastName: body.lastName,
|
|
216
|
-
addPhones: body.addPhones,
|
|
217
|
-
removePhones: body.removePhones,
|
|
218
|
-
addEmails: body.addEmails,
|
|
219
|
-
removeEmails: body.removeEmails,
|
|
220
|
-
});
|
|
221
|
-
if (!ok) {
|
|
222
|
-
res.status(500).json({
|
|
223
|
-
error: "contact update failed — see server logs. Contact may not exist, or write permission may be denied.",
|
|
224
|
-
});
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
res.status(200).json({ id, updated: true });
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
res.status(500).json({
|
|
231
|
-
error: `updateContact threw: ${error instanceof Error ? error.message : String(error)}`,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
89
|
+
setupService.updateConfig((cfg) => {
|
|
90
|
+
if (!cfg.connectors)
|
|
91
|
+
cfg.connectors = {};
|
|
92
|
+
const connectors = cfg.connectors;
|
|
93
|
+
const previous = connectors.imessage ?? {};
|
|
94
|
+
connectors.imessage = {
|
|
95
|
+
...previous,
|
|
96
|
+
enabled: true,
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
res.status(200).json(buildStatusResponse(runtime));
|
|
234
100
|
}
|
|
235
|
-
// ──
|
|
236
|
-
async function
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
const service = resolveService(runtime);
|
|
244
|
-
if (!service) {
|
|
245
|
-
res.status(503).json({ error: "imessage service not registered" });
|
|
101
|
+
// ── POST /api/setup/imessage/cancel ─────────────────────────────────
|
|
102
|
+
async function handleSetupCancel(_req, res, runtime) {
|
|
103
|
+
const setupService = getSetupService(runtime);
|
|
104
|
+
if (!setupService) {
|
|
105
|
+
res
|
|
106
|
+
.status(503)
|
|
107
|
+
.json(setupError("service_unavailable", "connector-setup service not registered"));
|
|
246
108
|
return;
|
|
247
109
|
}
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
res.status(200).json({ id, deleted: true });
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
res.status(500).json({
|
|
260
|
-
error: `deleteContact threw: ${error instanceof Error ? error.message : String(error)}`,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
110
|
+
setupService.updateConfig((cfg) => {
|
|
111
|
+
const connectors = (cfg.connectors ?? {});
|
|
112
|
+
delete connectors.imessage;
|
|
113
|
+
});
|
|
114
|
+
res.status(200).json({
|
|
115
|
+
connector: "imessage",
|
|
116
|
+
state: "idle",
|
|
117
|
+
});
|
|
263
118
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Plugin routes for iMessage service.
|
|
266
|
-
* Registered with `rawPath: true` to preserve legacy `/api/imessage/*` paths.
|
|
267
|
-
*
|
|
268
|
-
* Note: The PATCH and DELETE routes for `/api/imessage/contacts/:id` use
|
|
269
|
-
* the base `/api/imessage/contacts/` path with `rawPath: true`. The
|
|
270
|
-
* handler extracts the `:id` from req.url internally.
|
|
271
|
-
*/
|
|
272
119
|
export const imessageSetupRoutes = [
|
|
273
120
|
{
|
|
274
121
|
type: "GET",
|
|
275
|
-
path: "/api/imessage/status",
|
|
276
|
-
handler:
|
|
277
|
-
rawPath: true,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
type: "GET",
|
|
281
|
-
path: "/api/imessage/messages",
|
|
282
|
-
handler: handleMessages,
|
|
122
|
+
path: "/api/setup/imessage/status",
|
|
123
|
+
handler: handleSetupStatus,
|
|
283
124
|
rawPath: true,
|
|
284
125
|
},
|
|
285
126
|
{
|
|
286
127
|
type: "POST",
|
|
287
|
-
path: "/api/imessage/
|
|
288
|
-
handler:
|
|
289
|
-
rawPath: true,
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
type: "GET",
|
|
293
|
-
path: "/api/imessage/chats",
|
|
294
|
-
handler: handleChats,
|
|
295
|
-
rawPath: true,
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
type: "GET",
|
|
299
|
-
path: "/api/imessage/contacts",
|
|
300
|
-
handler: handleListContacts,
|
|
128
|
+
path: "/api/setup/imessage/start",
|
|
129
|
+
handler: handleSetupStart,
|
|
301
130
|
rawPath: true,
|
|
302
131
|
},
|
|
303
132
|
{
|
|
304
133
|
type: "POST",
|
|
305
|
-
path: "/api/imessage/
|
|
306
|
-
handler:
|
|
307
|
-
rawPath: true,
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
type: "PATCH",
|
|
311
|
-
path: "/api/imessage/contacts/:id",
|
|
312
|
-
handler: handleUpdateContact,
|
|
313
|
-
rawPath: true,
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
type: "DELETE",
|
|
317
|
-
path: "/api/imessage/contacts/:id",
|
|
318
|
-
handler: handleDeleteContact,
|
|
134
|
+
path: "/api/setup/imessage/cancel",
|
|
135
|
+
handler: handleSetupCancel,
|
|
319
136
|
rawPath: true,
|
|
320
137
|
},
|
|
321
138
|
];
|
package/dist/setup-routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-routes.js","sourceRoot":"","sources":["../src/setup-routes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"setup-routes.js","sourceRoot":"","sources":["../src/setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAkBH,SAAS,UAAU,CAAC,IAAY,EAAE,OAAe;IAC/C,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;AACtC,CAAC;AAED,MAAM,qBAAqB,GAAG,UAAU,CAAC;AA8BzC,SAAS,uBAAuB,CAAC,OAAgB;IAC/C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1D,MAAM,SAAS,GAAG,OAAyC,CAAC;IAC5D,OAAO,OAAO,SAAS,CAAC,SAAS,KAAK,UAAU,IAAI,OAAO,SAAS,CAAC,YAAY,KAAK,UAAU,CAAC;AACnG,CAAC;AAED,SAAS,eAAe,CAAC,OAAsB;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACtD,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED,SAAS,cAAc,CAAC,OAAsB;IAC5C,MAAM,GAAG,GAAG,OAAO,CAAC,U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AAC;QACrE,OAAO,UAAU,CAAC,QAAQ,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QACnB,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,MAAM;KAC2B,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C;QACE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,IAAI;KACd;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,gBAAgB;QACzB,OAAO,EAAE,IAAI;KACd;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,IAAI;KACd;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-imessage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"eliza-source": {
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"import": "./src/index.ts",
|
|
13
|
+
"default": "./src/index.ts"
|
|
14
|
+
},
|
|
10
15
|
"import": "./dist/index.js",
|
|
11
16
|
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./*.css": "./dist/*.css",
|
|
19
|
+
"./*": {
|
|
20
|
+
"types": "./dist/*.d.ts",
|
|
21
|
+
"eliza-source": {
|
|
22
|
+
"types": "./src/*.ts",
|
|
23
|
+
"import": "./src/*.ts",
|
|
24
|
+
"default": "./src/*.ts"
|
|
25
|
+
},
|
|
26
|
+
"import": "./dist/*.js",
|
|
27
|
+
"default": "./dist/*.js"
|
|
12
28
|
}
|
|
13
29
|
},
|
|
14
30
|
"files": [
|
|
31
|
+
"registry-entry.json",
|
|
15
32
|
"dist",
|
|
16
33
|
"auto-enable.ts"
|
|
17
34
|
],
|
|
@@ -31,10 +48,10 @@
|
|
|
31
48
|
"lint:check": "bunx @biomejs/biome check .",
|
|
32
49
|
"format": "bunx @biomejs/biome format --write .",
|
|
33
50
|
"format:check": "bunx @biomejs/biome format .",
|
|
34
|
-
"typecheck": "
|
|
51
|
+
"typecheck": "tsgo --noEmit"
|
|
35
52
|
},
|
|
36
53
|
"dependencies": {
|
|
37
|
-
"@elizaos/core": "2.0.
|
|
54
|
+
"@elizaos/core": "2.0.3-beta.3",
|
|
38
55
|
"zod": "^4.4.3"
|
|
39
56
|
},
|
|
40
57
|
"devDependencies": {
|
|
@@ -100,5 +117,6 @@
|
|
|
100
117
|
"sensitive": false
|
|
101
118
|
}
|
|
102
119
|
}
|
|
103
|
-
}
|
|
120
|
+
},
|
|
121
|
+
"gitHead": "f54b0f4eaed317d59fa7dbcdce20f4cdb0734420"
|
|
104
122
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "imessage",
|
|
3
|
+
"name": "iMessage",
|
|
4
|
+
"description": "iMessage connector for Mac-based conversations and message automation.",
|
|
5
|
+
"npmName": "@elizaos/plugin-imessage",
|
|
6
|
+
"version": "2.0.0-beta.0",
|
|
7
|
+
"source": "bundled",
|
|
8
|
+
"tags": [
|
|
9
|
+
"connector",
|
|
10
|
+
"messaging",
|
|
11
|
+
"imessage",
|
|
12
|
+
"apple",
|
|
13
|
+
"macos",
|
|
14
|
+
"social",
|
|
15
|
+
"social-chat"
|
|
16
|
+
],
|
|
17
|
+
"config": {
|
|
18
|
+
"IMESSAGE_DB_PATH": {
|
|
19
|
+
"type": "file-path",
|
|
20
|
+
"required": false,
|
|
21
|
+
"sensitive": false,
|
|
22
|
+
"label": "Db Path",
|
|
23
|
+
"help": "Path to database file",
|
|
24
|
+
"advanced": false
|
|
25
|
+
},
|
|
26
|
+
"IMESSAGE_ENABLED": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"required": false,
|
|
29
|
+
"sensitive": false,
|
|
30
|
+
"label": "Enabled",
|
|
31
|
+
"help": "Enable or disable this feature",
|
|
32
|
+
"advanced": false
|
|
33
|
+
},
|
|
34
|
+
"IMESSAGE_CLI_PATH": {
|
|
35
|
+
"type": "file-path",
|
|
36
|
+
"required": false,
|
|
37
|
+
"sensitive": false,
|
|
38
|
+
"label": "Cli Path",
|
|
39
|
+
"help": "Path to CLI binary",
|
|
40
|
+
"advanced": false
|
|
41
|
+
},
|
|
42
|
+
"IMESSAGE_DM_POLICY": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"required": false,
|
|
45
|
+
"sensitive": false,
|
|
46
|
+
"label": "Dm Policy",
|
|
47
|
+
"help": "DM policy (e.g. allow, deny, allowlist)",
|
|
48
|
+
"advanced": false
|
|
49
|
+
},
|
|
50
|
+
"IMESSAGE_ALLOW_FROM": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"required": false,
|
|
53
|
+
"sensitive": false,
|
|
54
|
+
"label": "Allow From",
|
|
55
|
+
"help": "Comma-separated allowed sender list",
|
|
56
|
+
"advanced": false
|
|
57
|
+
},
|
|
58
|
+
"IMESSAGE_GROUP_POLICY": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"required": false,
|
|
61
|
+
"sensitive": false,
|
|
62
|
+
"label": "Group Policy",
|
|
63
|
+
"help": "Group message policy",
|
|
64
|
+
"advanced": false
|
|
65
|
+
},
|
|
66
|
+
"IMESSAGE_POLL_INTERVAL_MS": {
|
|
67
|
+
"type": "number",
|
|
68
|
+
"required": false,
|
|
69
|
+
"sensitive": false,
|
|
70
|
+
"label": "Poll Interval Ms",
|
|
71
|
+
"help": "Polling interval in milliseconds",
|
|
72
|
+
"advanced": false,
|
|
73
|
+
"min": 0,
|
|
74
|
+
"unit": "ms"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"render": {
|
|
78
|
+
"visible": true,
|
|
79
|
+
"pinTo": [],
|
|
80
|
+
"style": "setup-panel",
|
|
81
|
+
"icon": "MessageSquare",
|
|
82
|
+
"group": "connector",
|
|
83
|
+
"groupOrder": 1,
|
|
84
|
+
"actions": [
|
|
85
|
+
"enable",
|
|
86
|
+
"configure",
|
|
87
|
+
"setup-guide"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"resources": {
|
|
91
|
+
"setupGuideUrl": "https://docs.eliza.ai/plugin-setup-guide#imessage-macos-only"
|
|
92
|
+
},
|
|
93
|
+
"dependsOn": [],
|
|
94
|
+
"kind": "connector",
|
|
95
|
+
"subtype": "messaging",
|
|
96
|
+
"auth": {
|
|
97
|
+
"kind": "token",
|
|
98
|
+
"credentialKeys": []
|
|
99
|
+
},
|
|
100
|
+
"channels": [
|
|
101
|
+
"imessage"
|
|
102
|
+
]
|
|
103
|
+
}
|