agent-messenger 2.27.2 → 2.29.0
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/.claude-plugin/README.md +11 -1
- package/.claude-plugin/marketplace.json +14 -1
- package/.claude-plugin/plugin.json +4 -2
- package/AGENTS.md +4 -0
- package/README.md +58 -10
- package/dist/package.json +10 -2
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +3 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/discord/client.d.ts +6 -2
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +10 -3
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discordbot/cli.js +1 -1
- package/dist/src/platforms/imessage/cli.d.ts +5 -0
- package/dist/src/platforms/imessage/cli.d.ts.map +1 -0
- package/dist/src/platforms/imessage/cli.js +31 -0
- package/dist/src/platforms/imessage/cli.js.map +1 -0
- package/dist/src/platforms/imessage/client.d.ts +43 -0
- package/dist/src/platforms/imessage/client.d.ts.map +1 -0
- package/dist/src/platforms/imessage/client.js +190 -0
- package/dist/src/platforms/imessage/client.js.map +1 -0
- package/dist/src/platforms/imessage/commands/auth.d.ts +31 -0
- package/dist/src/platforms/imessage/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/auth.js +100 -0
- package/dist/src/platforms/imessage/commands/auth.js.map +1 -0
- package/dist/src/platforms/imessage/commands/chat.d.ts +3 -0
- package/dist/src/platforms/imessage/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/chat.js +42 -0
- package/dist/src/platforms/imessage/commands/chat.js.map +1 -0
- package/dist/src/platforms/imessage/commands/doctor.d.ts +25 -0
- package/dist/src/platforms/imessage/commands/doctor.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/doctor.js +101 -0
- package/dist/src/platforms/imessage/commands/doctor.js.map +1 -0
- package/dist/src/platforms/imessage/commands/index.d.ts +7 -0
- package/dist/src/platforms/imessage/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/index.js +7 -0
- package/dist/src/platforms/imessage/commands/index.js.map +1 -0
- package/dist/src/platforms/imessage/commands/message.d.ts +5 -0
- package/dist/src/platforms/imessage/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/message.js +127 -0
- package/dist/src/platforms/imessage/commands/message.js.map +1 -0
- package/dist/src/platforms/imessage/commands/setup.d.ts +20 -0
- package/dist/src/platforms/imessage/commands/setup.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/setup.js +57 -0
- package/dist/src/platforms/imessage/commands/setup.js.map +1 -0
- package/dist/src/platforms/imessage/commands/shared.d.ts +10 -0
- package/dist/src/platforms/imessage/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/shared.js +53 -0
- package/dist/src/platforms/imessage/commands/shared.js.map +1 -0
- package/dist/src/platforms/imessage/commands/whoami.d.ts +3 -0
- package/dist/src/platforms/imessage/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/imessage/commands/whoami.js +20 -0
- package/dist/src/platforms/imessage/commands/whoami.js.map +1 -0
- package/dist/src/platforms/imessage/credential-manager.d.ts +22 -0
- package/dist/src/platforms/imessage/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/imessage/credential-manager.js +111 -0
- package/dist/src/platforms/imessage/credential-manager.js.map +1 -0
- package/dist/src/platforms/imessage/ensure-auth.d.ts +2 -0
- package/dist/src/platforms/imessage/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/imessage/ensure-auth.js +13 -0
- package/dist/src/platforms/imessage/ensure-auth.js.map +1 -0
- package/dist/src/platforms/imessage/errors.d.ts +3 -0
- package/dist/src/platforms/imessage/errors.d.ts.map +1 -0
- package/dist/src/platforms/imessage/errors.js +25 -0
- package/dist/src/platforms/imessage/errors.js.map +1 -0
- package/dist/src/platforms/imessage/index.d.ts +7 -0
- package/dist/src/platforms/imessage/index.d.ts.map +1 -0
- package/dist/src/platforms/imessage/index.js +5 -0
- package/dist/src/platforms/imessage/index.js.map +1 -0
- package/dist/src/platforms/imessage/rpc.d.ts +20 -0
- package/dist/src/platforms/imessage/rpc.d.ts.map +1 -0
- package/dist/src/platforms/imessage/rpc.js +133 -0
- package/dist/src/platforms/imessage/rpc.js.map +1 -0
- package/dist/src/platforms/imessage/types.d.ts +59 -0
- package/dist/src/platforms/imessage/types.d.ts.map +1 -0
- package/dist/src/platforms/imessage/types.js +29 -0
- package/dist/src/platforms/imessage/types.js.map +1 -0
- package/dist/src/platforms/instagram/cli.js +1 -1
- package/dist/src/platforms/instagram/client.d.ts +29 -2
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +360 -53
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts +1 -0
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js +123 -11
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts +4 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.js +17 -1
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
- package/dist/src/platforms/instagram/hybrid-listener.d.ts +48 -0
- package/dist/src/platforms/instagram/hybrid-listener.d.ts.map +1 -0
- package/dist/src/platforms/instagram/hybrid-listener.js +154 -0
- package/dist/src/platforms/instagram/hybrid-listener.js.map +1 -0
- package/dist/src/platforms/instagram/index.d.ts +2 -0
- package/dist/src/platforms/instagram/index.d.ts.map +1 -1
- package/dist/src/platforms/instagram/index.js +2 -0
- package/dist/src/platforms/instagram/index.js.map +1 -1
- package/dist/src/platforms/instagram/mqtt/connection.d.ts +4 -0
- package/dist/src/platforms/instagram/mqtt/connection.d.ts.map +1 -0
- package/dist/src/platforms/instagram/mqtt/connection.js +66 -0
- package/dist/src/platforms/instagram/mqtt/connection.js.map +1 -0
- package/dist/src/platforms/instagram/mqtt/thrift.d.ts +22 -0
- package/dist/src/platforms/instagram/mqtt/thrift.d.ts.map +1 -0
- package/dist/src/platforms/instagram/mqtt/thrift.js +143 -0
- package/dist/src/platforms/instagram/mqtt/thrift.js.map +1 -0
- package/dist/src/platforms/instagram/mqtt/transport.d.ts +42 -0
- package/dist/src/platforms/instagram/mqtt/transport.d.ts.map +1 -0
- package/dist/src/platforms/instagram/mqtt/transport.js +246 -0
- package/dist/src/platforms/instagram/mqtt/transport.js.map +1 -0
- package/dist/src/platforms/instagram/realtime-listener.d.ts +33 -0
- package/dist/src/platforms/instagram/realtime-listener.d.ts.map +1 -0
- package/dist/src/platforms/instagram/realtime-listener.js +151 -0
- package/dist/src/platforms/instagram/realtime-listener.js.map +1 -0
- package/dist/src/platforms/instagram/types.d.ts +10 -8
- package/dist/src/platforms/instagram/types.d.ts.map +1 -1
- package/dist/src/platforms/instagram/types.js.map +1 -1
- package/dist/src/platforms/kakaotalk/cli.js +1 -1
- package/dist/src/platforms/line/cli.js +1 -1
- package/dist/src/platforms/teams/app-config.d.ts +36 -0
- package/dist/src/platforms/teams/app-config.d.ts.map +1 -0
- package/dist/src/platforms/teams/app-config.js +69 -0
- package/dist/src/platforms/teams/app-config.js.map +1 -0
- package/dist/src/platforms/teams/client.d.ts +19 -2
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js +295 -7
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts +10 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +137 -3
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/file.d.ts +3 -0
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/file.js +59 -2
- package/dist/src/platforms/teams/commands/file.js.map +1 -1
- package/dist/src/platforms/teams/commands/message.d.ts +11 -0
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/message.js +121 -2
- package/dist/src/platforms/teams/commands/message.js.map +1 -1
- package/dist/src/platforms/teams/credential-manager.d.ts +23 -1
- package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/teams/credential-manager.js +46 -2
- package/dist/src/platforms/teams/credential-manager.js.map +1 -1
- package/dist/src/platforms/teams/device-code.d.ts +48 -0
- package/dist/src/platforms/teams/device-code.d.ts.map +1 -0
- package/dist/src/platforms/teams/device-code.js +199 -0
- package/dist/src/platforms/teams/device-code.js.map +1 -0
- package/dist/src/platforms/teams/device-login.d.ts +37 -0
- package/dist/src/platforms/teams/device-login.d.ts.map +1 -0
- package/dist/src/platforms/teams/device-login.js +129 -0
- package/dist/src/platforms/teams/device-login.js.map +1 -0
- package/dist/src/platforms/teams/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.js +12 -0
- package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
- package/dist/src/platforms/teams/index.d.ts +7 -3
- package/dist/src/platforms/teams/index.d.ts.map +1 -1
- package/dist/src/platforms/teams/index.js +5 -2
- package/dist/src/platforms/teams/index.js.map +1 -1
- package/dist/src/platforms/teams/listener.d.ts +35 -0
- package/dist/src/platforms/teams/listener.d.ts.map +1 -0
- package/dist/src/platforms/teams/listener.js +236 -0
- package/dist/src/platforms/teams/listener.js.map +1 -0
- package/dist/src/platforms/teams/realm-discovery.d.ts +3 -0
- package/dist/src/platforms/teams/realm-discovery.d.ts.map +1 -0
- package/dist/src/platforms/teams/realm-discovery.js +33 -0
- package/dist/src/platforms/teams/realm-discovery.js.map +1 -0
- package/dist/src/platforms/teams/token-extractor.d.ts +3 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +60 -0
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/teams/token-provider.d.ts +25 -0
- package/dist/src/platforms/teams/token-provider.d.ts.map +1 -0
- package/dist/src/platforms/teams/token-provider.js +190 -0
- package/dist/src/platforms/teams/token-provider.js.map +1 -0
- package/dist/src/platforms/teams/trouter.d.ts +31 -0
- package/dist/src/platforms/teams/trouter.d.ts.map +1 -0
- package/dist/src/platforms/teams/trouter.js +181 -0
- package/dist/src/platforms/teams/trouter.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +94 -0
- package/dist/src/platforms/teams/types.d.ts.map +1 -1
- package/dist/src/platforms/teams/types.js +30 -0
- package/dist/src/platforms/teams/types.js.map +1 -1
- package/dist/src/platforms/webex/cli.js +1 -1
- package/dist/src/platforms/webex/types.d.ts +1 -1
- package/dist/src/platforms/webexbot/cli.js +1 -1
- package/dist/src/platforms/wechatbot/cli.js +1 -1
- package/dist/src/platforms/whatsapp/cli.js +1 -1
- package/dist/src/platforms/whatsappbot/cli.js +1 -1
- package/dist/src/tui/adapters/imessage-adapter.d.ts +21 -0
- package/dist/src/tui/adapters/imessage-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/imessage-adapter.js +110 -0
- package/dist/src/tui/adapters/imessage-adapter.js.map +1 -0
- package/dist/src/tui/adapters/instagram-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/instagram-adapter.js +16 -0
- package/dist/src/tui/adapters/instagram-adapter.js.map +1 -1
- package/dist/src/tui/adapters/teams-adapter.d.ts +3 -0
- package/dist/src/tui/adapters/teams-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/teams-adapter.js +21 -0
- package/dist/src/tui/adapters/teams-adapter.js.map +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +12 -3
- package/dist/src/tui/app.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +1 -1
- package/docs/content/docs/cli/imessage.mdx +99 -0
- package/docs/content/docs/cli/instagram.mdx +2 -1
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/teams.mdx +22 -0
- package/docs/content/docs/index.mdx +9 -6
- package/docs/content/docs/quick-start.mdx +2 -0
- package/docs/content/docs/sdk/instagram.mdx +90 -5
- package/docs/content/docs/tui.mdx +4 -3
- package/package.json +10 -2
- package/scripts/postbuild.ts +12 -15
- package/skills/agent-channeltalk/SKILL.md +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-imessage/SKILL.md +133 -0
- package/skills/agent-imessage/references/authentication.md +66 -0
- package/skills/agent-imessage/references/permissions.md +31 -0
- package/skills/agent-imessage/references/setup.md +49 -0
- package/skills/agent-instagram/SKILL.md +72 -2
- package/skills/agent-instagram/references/authentication.md +11 -0
- package/skills/agent-instagram/references/common-patterns.md +36 -0
- package/skills/agent-instagram/templates/monitor-chat.sh +5 -0
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +59 -6
- package/skills/agent-teams/references/authentication.md +31 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-webexbot/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/cli.ts +4 -0
- package/src/platforms/discord/client.test.ts +86 -0
- package/src/platforms/discord/client.ts +10 -3
- package/src/platforms/imessage/cli.ts +39 -0
- package/src/platforms/imessage/client.test.ts +137 -0
- package/src/platforms/imessage/client.ts +253 -0
- package/src/platforms/imessage/commands/auth.ts +142 -0
- package/src/platforms/imessage/commands/chat.ts +51 -0
- package/src/platforms/imessage/commands/doctor.test.ts +80 -0
- package/src/platforms/imessage/commands/doctor.ts +139 -0
- package/src/platforms/imessage/commands/index.ts +6 -0
- package/src/platforms/imessage/commands/message.test.ts +20 -0
- package/src/platforms/imessage/commands/message.ts +151 -0
- package/src/platforms/imessage/commands/setup.test.ts +52 -0
- package/src/platforms/imessage/commands/setup.ts +76 -0
- package/src/platforms/imessage/commands/shared.test.ts +19 -0
- package/src/platforms/imessage/commands/shared.ts +69 -0
- package/src/platforms/imessage/commands/whoami.ts +22 -0
- package/src/platforms/imessage/credential-manager.test.ts +122 -0
- package/src/platforms/imessage/credential-manager.ts +123 -0
- package/src/platforms/imessage/ensure-auth.ts +18 -0
- package/src/platforms/imessage/errors.ts +27 -0
- package/src/platforms/imessage/index.test.ts +13 -0
- package/src/platforms/imessage/index.ts +16 -0
- package/src/platforms/imessage/rpc.ts +157 -0
- package/src/platforms/imessage/test-stub-imsg.mjs +147 -0
- package/src/platforms/imessage/types.test.ts +47 -0
- package/src/platforms/imessage/types.ts +95 -0
- package/src/platforms/instagram/client.test.ts +478 -33
- package/src/platforms/instagram/client.ts +472 -68
- package/src/platforms/instagram/commands/auth.test.ts +177 -1
- package/src/platforms/instagram/commands/auth.ts +182 -11
- package/src/platforms/instagram/credential-manager.test.ts +30 -0
- package/src/platforms/instagram/credential-manager.ts +23 -1
- package/src/platforms/instagram/hybrid-listener.test.ts +135 -0
- package/src/platforms/instagram/hybrid-listener.ts +196 -0
- package/src/platforms/instagram/index.ts +10 -0
- package/src/platforms/instagram/mqtt/connection.ts +72 -0
- package/src/platforms/instagram/mqtt/thrift.test.ts +91 -0
- package/src/platforms/instagram/mqtt/thrift.ts +159 -0
- package/src/platforms/instagram/mqtt/transport.ts +285 -0
- package/src/platforms/instagram/realtime-listener.test.ts +34 -0
- package/src/platforms/instagram/realtime-listener.ts +201 -0
- package/src/platforms/instagram/types.ts +11 -8
- package/src/platforms/teams/app-config.ts +92 -0
- package/src/platforms/teams/client.test.ts +335 -1
- package/src/platforms/teams/client.ts +342 -7
- package/src/platforms/teams/commands/auth.test.ts +93 -1
- package/src/platforms/teams/commands/auth.ts +182 -3
- package/src/platforms/teams/commands/file.test.ts +92 -1
- package/src/platforms/teams/commands/file.ts +76 -1
- package/src/platforms/teams/commands/message.test.ts +95 -1
- package/src/platforms/teams/commands/message.ts +145 -3
- package/src/platforms/teams/credential-manager.test.ts +20 -0
- package/src/platforms/teams/credential-manager.ts +68 -3
- package/src/platforms/teams/device-code.test.ts +311 -0
- package/src/platforms/teams/device-code.ts +277 -0
- package/src/platforms/teams/device-login.test.ts +288 -0
- package/src/platforms/teams/device-login.ts +206 -0
- package/src/platforms/teams/ensure-auth.ts +11 -0
- package/src/platforms/teams/index.test.ts +10 -0
- package/src/platforms/teams/index.ts +16 -1
- package/src/platforms/teams/listener.ts +295 -0
- package/src/platforms/teams/realm-discovery.test.ts +73 -0
- package/src/platforms/teams/realm-discovery.ts +42 -0
- package/src/platforms/teams/token-extractor.ts +69 -0
- package/src/platforms/teams/token-provider.test.ts +227 -0
- package/src/platforms/teams/token-provider.ts +284 -0
- package/src/platforms/teams/trouter.test.ts +114 -0
- package/src/platforms/teams/trouter.ts +228 -0
- package/src/platforms/teams/types.test.ts +17 -0
- package/src/platforms/teams/types.ts +86 -0
- package/src/platforms/webexbot/cli.ts +0 -0
- package/src/tui/adapters/imessage-adapter.ts +131 -0
- package/src/tui/adapters/instagram-adapter.ts +13 -0
- package/src/tui/adapters/teams-adapter.ts +23 -0
- package/src/tui/app.ts +16 -3
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { classifyImsgFailure } from './errors.js';
|
|
3
|
+
import { ImsgRpc } from './rpc.js';
|
|
4
|
+
import { IMessageError } from './types.js';
|
|
5
|
+
const STANDARD_REACTIONS = new Set(['love', 'like', 'dislike', 'laugh', 'emphasis', 'question']);
|
|
6
|
+
const defaultRunner = (binaryPath, args) => new Promise((resolve, reject) => {
|
|
7
|
+
let proc;
|
|
8
|
+
try {
|
|
9
|
+
proc = spawn(binaryPath, args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
reject(new IMessageError(`Could not run "${binaryPath}".`, 'imsg_not_found'));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
let stdout = '';
|
|
16
|
+
let stderr = '';
|
|
17
|
+
proc.stdout?.on('data', (c) => (stdout += c.toString()));
|
|
18
|
+
proc.stderr?.on('data', (c) => (stderr += c.toString()));
|
|
19
|
+
proc.once('error', (err) => {
|
|
20
|
+
reject(err.code === 'ENOENT'
|
|
21
|
+
? new IMessageError(`Could not run "${binaryPath}".`, 'imsg_not_found', {
|
|
22
|
+
suggestion: 'Install imsg: "brew install steipete/tap/imsg".',
|
|
23
|
+
doctorCommand: 'agent-imessage doctor',
|
|
24
|
+
})
|
|
25
|
+
: err);
|
|
26
|
+
});
|
|
27
|
+
proc.once('close', (code) => resolve({ code: code ?? 0, stdout, stderr }));
|
|
28
|
+
});
|
|
29
|
+
function summarizeMessage(msg) {
|
|
30
|
+
return {
|
|
31
|
+
id: msg.id,
|
|
32
|
+
guid: msg.guid,
|
|
33
|
+
chat_id: msg.chat_id,
|
|
34
|
+
from: msg.is_from_me ? '' : (msg.sender ?? ''),
|
|
35
|
+
from_name: msg.sender_name ?? undefined,
|
|
36
|
+
is_outgoing: Boolean(msg.is_from_me),
|
|
37
|
+
timestamp: msg.created_at ?? new Date(0).toISOString(),
|
|
38
|
+
text: msg.text ?? undefined,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function summarizeChat(chat) {
|
|
42
|
+
return {
|
|
43
|
+
id: chat.id,
|
|
44
|
+
guid: chat.guid ?? null,
|
|
45
|
+
identifier: chat.identifier ?? null,
|
|
46
|
+
name: chat.name?.trim() || chat.identifier || chat.guid || String(chat.id),
|
|
47
|
+
service: chat.service ?? 'iMessage',
|
|
48
|
+
is_group: Boolean(chat.is_group),
|
|
49
|
+
participants: chat.participants ?? [],
|
|
50
|
+
last_message: chat.last_message ? summarizeMessage(chat.last_message) : undefined,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export class ImsgClient {
|
|
54
|
+
binaryPath = 'imsg';
|
|
55
|
+
region;
|
|
56
|
+
rpc;
|
|
57
|
+
runner;
|
|
58
|
+
constructor(deps) {
|
|
59
|
+
this.rpc = deps?.rpc ?? new ImsgRpc();
|
|
60
|
+
this.runner = deps?.runner ?? defaultRunner;
|
|
61
|
+
}
|
|
62
|
+
async login(credentials) {
|
|
63
|
+
if (credentials) {
|
|
64
|
+
this.binaryPath = credentials.binaryPath ?? 'imsg';
|
|
65
|
+
this.region = credentials.region;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
const { IMessageCredentialManager } = await import('./credential-manager.js');
|
|
69
|
+
const resolved = await new IMessageCredentialManager().resolveAccount();
|
|
70
|
+
this.binaryPath = resolved?.binary_path ?? 'imsg';
|
|
71
|
+
this.region = resolved?.region;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
async connect() {
|
|
75
|
+
await this.rpc.start(this.binaryPath);
|
|
76
|
+
await this.rpc.request('chats.list', { limit: 1 });
|
|
77
|
+
}
|
|
78
|
+
async getVersion() {
|
|
79
|
+
const result = await this.runner(this.binaryPath, ['--version']);
|
|
80
|
+
if (result.code !== 0)
|
|
81
|
+
return null;
|
|
82
|
+
return result.stdout.trim() || null;
|
|
83
|
+
}
|
|
84
|
+
async getStatus() {
|
|
85
|
+
let version = null;
|
|
86
|
+
let fullDiskAccess = false;
|
|
87
|
+
try {
|
|
88
|
+
version = await this.getVersion();
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
version = null;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
await this.rpc.request('chats.list', { limit: 1 });
|
|
95
|
+
fullDiskAccess = true;
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
fullDiskAccess = false;
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
imsg_version: version,
|
|
102
|
+
binary_path: this.binaryPath,
|
|
103
|
+
full_disk_access: fullDiskAccess,
|
|
104
|
+
automation: 'unknown',
|
|
105
|
+
bridge_available: false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
async listChats(limit = 25) {
|
|
109
|
+
const result = await this.rpc.request('chats.list', { limit });
|
|
110
|
+
return result.chats.map(summarizeChat);
|
|
111
|
+
}
|
|
112
|
+
async searchChats(query, limit = 25) {
|
|
113
|
+
const all = await this.listChats(Math.max(limit, 100));
|
|
114
|
+
const lower = query.toLowerCase();
|
|
115
|
+
return all
|
|
116
|
+
.filter((c) => c.name.toLowerCase().includes(lower) || (c.identifier ?? '').toLowerCase().includes(lower))
|
|
117
|
+
.slice(0, limit);
|
|
118
|
+
}
|
|
119
|
+
async getMessages(chatId, limit = 25, start) {
|
|
120
|
+
const result = await this.rpc.request('messages.history', {
|
|
121
|
+
chat_id: chatId,
|
|
122
|
+
limit,
|
|
123
|
+
...(start ? { start } : {}),
|
|
124
|
+
});
|
|
125
|
+
return result.messages.map(summarizeMessage).sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp));
|
|
126
|
+
}
|
|
127
|
+
async sendMessage(target, text) {
|
|
128
|
+
const params = { text };
|
|
129
|
+
if (target.chatId !== undefined)
|
|
130
|
+
params.chat_id = target.chatId;
|
|
131
|
+
else if (target.chatGuid)
|
|
132
|
+
params.chat_guid = target.chatGuid;
|
|
133
|
+
else if (target.chatIdentifier)
|
|
134
|
+
params.chat_identifier = target.chatIdentifier;
|
|
135
|
+
else if (target.to)
|
|
136
|
+
params.to = target.to;
|
|
137
|
+
else
|
|
138
|
+
throw new IMessageError('A chat id, guid, or recipient is required to send.', 'chat_not_found');
|
|
139
|
+
if (this.region)
|
|
140
|
+
params.region = this.region;
|
|
141
|
+
const result = await this.rpc.request('send', params);
|
|
142
|
+
return {
|
|
143
|
+
id: result.id ?? 0,
|
|
144
|
+
guid: result.guid ?? '',
|
|
145
|
+
chat_id: target.chatId ?? 0,
|
|
146
|
+
from: '',
|
|
147
|
+
is_outgoing: true,
|
|
148
|
+
timestamp: new Date().toISOString(),
|
|
149
|
+
text,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async sendReaction(chatId, reaction, messageGuid) {
|
|
153
|
+
if (messageGuid) {
|
|
154
|
+
throw new IMessageError('Reacting to a specific message requires the imsg Private API bridge.', 'private_api_required', { suggestion: 'Enable the bridge with "imsg launch" (requires SIP disabled).' });
|
|
155
|
+
}
|
|
156
|
+
if (!STANDARD_REACTIONS.has(reaction)) {
|
|
157
|
+
throw new IMessageError(`Custom reactions require the imsg Private API bridge. Standard tapbacks: ${[...STANDARD_REACTIONS].join(', ')}.`, 'private_api_required', { suggestion: 'Enable the bridge with "imsg launch" (requires SIP disabled).' });
|
|
158
|
+
}
|
|
159
|
+
const result = await this.runner(this.binaryPath, [
|
|
160
|
+
'react',
|
|
161
|
+
'--chat-id',
|
|
162
|
+
String(chatId),
|
|
163
|
+
'--reaction',
|
|
164
|
+
reaction,
|
|
165
|
+
'--json',
|
|
166
|
+
]);
|
|
167
|
+
if (result.code !== 0) {
|
|
168
|
+
const detail = result.stderr.trim() || result.stdout.trim() || 'Reaction failed.';
|
|
169
|
+
throw classifyImsgFailure(detail, 'send_failed');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async watch(onMessage, options = {}) {
|
|
173
|
+
const params = { include_reactions: false };
|
|
174
|
+
if (options.chatId !== undefined)
|
|
175
|
+
params.chat_id = options.chatId;
|
|
176
|
+
if (options.sinceRowId !== undefined)
|
|
177
|
+
params.since_rowid = options.sinceRowId;
|
|
178
|
+
const subscription = await this.rpc.subscribe(params, (raw) => onMessage(summarizeMessage(raw)), options.onError);
|
|
179
|
+
return async () => {
|
|
180
|
+
await this.rpc.unsubscribe(subscription);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async getProfile() {
|
|
184
|
+
return this.getStatus();
|
|
185
|
+
}
|
|
186
|
+
async close() {
|
|
187
|
+
this.rpc.close();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/platforms/imessage/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAA8E,aAAa,EAAE,MAAM,SAAS,CAAA;AAwBnH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAA;AAchG,MAAM,aAAa,GAAkB,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CACxD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,IAAI,IAA8B,CAAA;IAClC,IAAI,CAAC;QACH,IAAI,GAAG,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,IAAI,aAAa,CAAC,kBAAkB,UAAU,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAA;QAC7E,OAAM;IACR,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAChE,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CAAC,OAAO,CAChB,CAAA;QACD,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QAC1C,CAAC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,SAAS,EAAE,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { IMessageCredentialManager } from '../credential-manager.js';
|
|
3
|
+
interface SetOptions {
|
|
4
|
+
bin?: string;
|
|
5
|
+
region?: string;
|
|
6
|
+
account?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
current?: boolean;
|
|
9
|
+
pretty?: boolean;
|
|
10
|
+
_manager?: IMessageCredentialManager;
|
|
11
|
+
}
|
|
12
|
+
declare function runSet(options: SetOptions): Promise<void>;
|
|
13
|
+
declare function runList(options: {
|
|
14
|
+
pretty?: boolean;
|
|
15
|
+
_manager?: IMessageCredentialManager;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
declare function runUse(accountId: string, options: {
|
|
18
|
+
pretty?: boolean;
|
|
19
|
+
_manager?: IMessageCredentialManager;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
declare function runRemove(accountId: string, options: {
|
|
22
|
+
pretty?: boolean;
|
|
23
|
+
_manager?: IMessageCredentialManager;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
declare function runLogout(options: {
|
|
26
|
+
pretty?: boolean;
|
|
27
|
+
_manager?: IMessageCredentialManager;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
export declare const authCommand: Command;
|
|
30
|
+
export { runSet, runList, runUse, runRemove, runLogout };
|
|
31
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAA;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { handleError } from '../../../shared/utils/error-handler.js';
|
|
3
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
4
|
+
import { IMessageCredentialManager } from '../credential-manager.js';
|
|
5
|
+
import { createAccountId } from '../types.js';
|
|
6
|
+
async function guard(fn) {
|
|
7
|
+
try {
|
|
8
|
+
await fn();
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
handleError(error);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function runSet(options) {
|
|
15
|
+
const manager = options._manager ?? new IMessageCredentialManager();
|
|
16
|
+
const now = new Date().toISOString();
|
|
17
|
+
const accountId = createAccountId(options.account ?? options.label ?? options.bin ?? 'default');
|
|
18
|
+
await manager.setAccount({
|
|
19
|
+
account_id: accountId,
|
|
20
|
+
provider: 'imsg',
|
|
21
|
+
label: options.label,
|
|
22
|
+
binary_path: options.bin,
|
|
23
|
+
region: options.region,
|
|
24
|
+
created_at: now,
|
|
25
|
+
updated_at: now,
|
|
26
|
+
});
|
|
27
|
+
if (options.current)
|
|
28
|
+
await manager.setCurrent(accountId);
|
|
29
|
+
console.log(formatOutput({ success: true, account_id: accountId, binary_path: options.bin ?? 'imsg' }, options.pretty));
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
async function runList(options) {
|
|
33
|
+
const manager = options._manager ?? new IMessageCredentialManager();
|
|
34
|
+
const accounts = await manager.listAccounts();
|
|
35
|
+
console.log(formatOutput(accounts.map((a) => ({
|
|
36
|
+
account_id: a.account_id,
|
|
37
|
+
label: a.label,
|
|
38
|
+
binary_path: a.binary_path ?? 'imsg',
|
|
39
|
+
region: a.region,
|
|
40
|
+
is_current: a.is_current,
|
|
41
|
+
})), options.pretty));
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
async function runUse(accountId, options) {
|
|
45
|
+
const manager = options._manager ?? new IMessageCredentialManager();
|
|
46
|
+
const found = await manager.setCurrent(accountId);
|
|
47
|
+
if (!found) {
|
|
48
|
+
console.log(formatOutput({ error: `Account "${accountId}" not found. Run "auth list".` }, options.pretty));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
console.log(formatOutput({ success: true, account_id: createAccountId(accountId) }, options.pretty));
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
async function runRemove(accountId, options) {
|
|
55
|
+
const manager = options._manager ?? new IMessageCredentialManager();
|
|
56
|
+
const removed = await manager.removeAccount(accountId);
|
|
57
|
+
if (!removed) {
|
|
58
|
+
console.log(formatOutput({ error: `Account "${accountId}" not found. Run "auth list".` }, options.pretty));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
console.log(formatOutput({ success: true }, options.pretty));
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
async function runLogout(options) {
|
|
65
|
+
const manager = options._manager ?? new IMessageCredentialManager();
|
|
66
|
+
await manager.clearCredentials();
|
|
67
|
+
console.log(formatOutput({ success: true }, options.pretty));
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
export const authCommand = new Command('auth')
|
|
71
|
+
.description('Account configuration commands')
|
|
72
|
+
.addCommand(new Command('set')
|
|
73
|
+
.description('Configure an iMessage account (imsg binary path / region)')
|
|
74
|
+
.option('--bin <path>', 'Path to the imsg binary (default: imsg on PATH)')
|
|
75
|
+
.option('--region <code>', 'Default region for local-format phone numbers (e.g. US)')
|
|
76
|
+
.option('--account <id>', 'Account id/alias')
|
|
77
|
+
.option('--label <label>', 'Human-friendly label')
|
|
78
|
+
.option('--current', 'Set as the active account')
|
|
79
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
80
|
+
.action(async (opts) => guard(() => runSet(opts))))
|
|
81
|
+
.addCommand(new Command('list')
|
|
82
|
+
.description('List configured accounts')
|
|
83
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
84
|
+
.action(async (opts) => guard(() => runList(opts))))
|
|
85
|
+
.addCommand(new Command('use')
|
|
86
|
+
.description('Switch the active account')
|
|
87
|
+
.argument('<account-id>', 'Account id')
|
|
88
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
89
|
+
.action(async (accountId, opts) => guard(() => runUse(accountId, opts))))
|
|
90
|
+
.addCommand(new Command('remove')
|
|
91
|
+
.description('Remove a configured account')
|
|
92
|
+
.argument('<account-id>', 'Account id')
|
|
93
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
94
|
+
.action(async (accountId, opts) => guard(() => runRemove(accountId, opts))))
|
|
95
|
+
.addCommand(new Command('logout')
|
|
96
|
+
.description('Clear all stored accounts')
|
|
97
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
98
|
+
.action(async (opts) => guard(() => runLogout(opts))));
|
|
99
|
+
export { runSet, runList, runUse, runRemove, runLogout };
|
|
100
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,KAAK,UAAU,KAAK,CAAC,EAAuB;IAC1C,IAAI,CAAC;QACH,MAAM,EAAE,EAAE,CAAA;IACZ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,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d.ts","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgCnC,eAAO,MAAM,WAAW,SAkBrB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { handleError } from '../../../shared/utils/error-handler.js';
|
|
3
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
4
|
+
import { parseLimitOption, withImsgClient } from './shared.js';
|
|
5
|
+
async function listAction(options) {
|
|
6
|
+
try {
|
|
7
|
+
const limit = parseLimitOption(options.limit, 25);
|
|
8
|
+
const chats = await withImsgClient(options, (client) => client.listChats(limit));
|
|
9
|
+
console.log(formatOutput(chats, options.pretty));
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
handleError(error);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function searchAction(query, options) {
|
|
17
|
+
try {
|
|
18
|
+
const limit = parseLimitOption(options.limit, 25);
|
|
19
|
+
const chats = await withImsgClient(options, (client) => client.searchChats(query, limit));
|
|
20
|
+
console.log(formatOutput(chats, options.pretty));
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
handleError(error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const chatCommand = new Command('chat')
|
|
28
|
+
.description('iMessage chat commands')
|
|
29
|
+
.addCommand(new Command('list')
|
|
30
|
+
.description('List chats')
|
|
31
|
+
.option('--limit <n>', 'Number of chats to fetch', '25')
|
|
32
|
+
.option('--account <id>', 'Use a specific iMessage account')
|
|
33
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
34
|
+
.action(listAction))
|
|
35
|
+
.addCommand(new Command('search')
|
|
36
|
+
.description('Search chats by name or identifier')
|
|
37
|
+
.argument('<query>', 'Search query')
|
|
38
|
+
.option('--limit <n>', 'Number of results to return', '25')
|
|
39
|
+
.option('--account <id>', 'Use a specific iMessage account')
|
|
40
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
41
|
+
.action(searchAction));
|
|
42
|
+
//# sourceMappingURL=chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE3D,KAAK,UAAU,UAAU,CAAC,OAA+D;IACvF,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACjD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAChF,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CACzB,KAAa,EACb,OAA+D;IAE/D,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACjD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;QACzF,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,wBAAwB,CAAC;KACrC,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,YAAY,CAAC;KACzB,MAAM,CAAC,aAAa,EAAE,0BAA0B,EAAE,IAAI,CAAC;KACvD,MAAM,CAAC,gBAAgB,EAAE,iCAAiC,CAAC;KAC3D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;KACnC,MAAM,CAAC,aAAa,EAAE,6BAA6B,EAAE,IAAI,CAAC;KAC1D,MAAM,CAAC,gBAAgB,EAAE,iCAAiC,CAAC;KAC3D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { ImsgClient } from '../client.js';
|
|
3
|
+
export interface DoctorReport {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
imsg: 'found' | 'missing';
|
|
6
|
+
imsg_version?: string | null;
|
|
7
|
+
binary_path: string;
|
|
8
|
+
full_disk_access: 'ok' | 'denied' | 'unknown';
|
|
9
|
+
automation: string;
|
|
10
|
+
bridge: 'enabled' | 'disabled';
|
|
11
|
+
test_chat?: string;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
error?: string;
|
|
14
|
+
code?: string;
|
|
15
|
+
suggestion?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function runDoctor(options: {
|
|
18
|
+
account?: string;
|
|
19
|
+
bin?: string;
|
|
20
|
+
region?: string;
|
|
21
|
+
testChat?: number;
|
|
22
|
+
client?: ImsgClient;
|
|
23
|
+
}): Promise<DoctorReport>;
|
|
24
|
+
export declare const doctorCommand: Command;
|
|
25
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAItC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,GAAG,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,SAAS,GAAG,UAAU,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,GAAG,OAAO,CAAC,YAAY,CAAC,CA+FxB;AAED,eAAO,MAAM,aAAa,SAYtB,CAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
3
|
+
import { ImsgClient } from '../client.js';
|
|
4
|
+
import { IMessageCredentialManager } from '../credential-manager.js';
|
|
5
|
+
export async function runDoctor(options) {
|
|
6
|
+
const resolved = await new IMessageCredentialManager().resolveAccount(options.account);
|
|
7
|
+
const binaryPath = options.bin ?? resolved?.binary_path ?? process.env.AGENT_IMESSAGE_BIN ?? 'imsg';
|
|
8
|
+
const region = options.region ?? resolved?.region;
|
|
9
|
+
const client = options.client ?? new ImsgClient();
|
|
10
|
+
await client.login({ binaryPath, region });
|
|
11
|
+
const warnings = [];
|
|
12
|
+
let version = null;
|
|
13
|
+
let versionError;
|
|
14
|
+
try {
|
|
15
|
+
version = await client.getVersion();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
versionError = error;
|
|
19
|
+
}
|
|
20
|
+
if (version === null) {
|
|
21
|
+
const code = versionError?.code ?? 'imsg_not_found';
|
|
22
|
+
return {
|
|
23
|
+
ok: false,
|
|
24
|
+
imsg: 'missing',
|
|
25
|
+
binary_path: binaryPath,
|
|
26
|
+
full_disk_access: 'unknown',
|
|
27
|
+
automation: 'unknown',
|
|
28
|
+
bridge: 'disabled',
|
|
29
|
+
warnings,
|
|
30
|
+
error: versionError?.message ?? `Could not run "${binaryPath} --version".`,
|
|
31
|
+
code,
|
|
32
|
+
suggestion: versionError?.suggestion ??
|
|
33
|
+
(code === 'imsg_not_found' ? 'Install imsg: "brew install steipete/tap/imsg".' : undefined),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
let connectError;
|
|
37
|
+
try {
|
|
38
|
+
await client.connect();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
connectError = error;
|
|
42
|
+
}
|
|
43
|
+
if (connectError) {
|
|
44
|
+
await client.close();
|
|
45
|
+
const isFda = connectError.code === 'full_disk_access';
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
imsg: 'found',
|
|
49
|
+
imsg_version: version,
|
|
50
|
+
binary_path: binaryPath,
|
|
51
|
+
full_disk_access: isFda ? 'denied' : 'unknown',
|
|
52
|
+
automation: 'unknown',
|
|
53
|
+
bridge: 'disabled',
|
|
54
|
+
warnings,
|
|
55
|
+
error: connectError.message,
|
|
56
|
+
code: connectError.code,
|
|
57
|
+
suggestion: connectError.suggestion ??
|
|
58
|
+
(isFda
|
|
59
|
+
? 'Grant Full Disk Access to the app/terminal launching agent-messenger (System Settings → Privacy & Security → Full Disk Access). macOS grants to the parent process.'
|
|
60
|
+
: undefined),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
warnings.push('Automation (Messages) is verified on first send. If sends fail, grant Privacy → Automation → Messages.');
|
|
64
|
+
warnings.push('Private API bridge disabled — send/read/watch/standard tapbacks work; typing/edit/group mgmt need "imsg launch" (SIP off).');
|
|
65
|
+
let testChatResult;
|
|
66
|
+
if (options.testChat !== undefined) {
|
|
67
|
+
try {
|
|
68
|
+
await client.sendMessage({ chatId: options.testChat }, 'agent-imessage doctor test message');
|
|
69
|
+
testChatResult = 'sent';
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
testChatResult = `failed: ${error.message}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
await client.close();
|
|
76
|
+
return {
|
|
77
|
+
ok: true,
|
|
78
|
+
imsg: 'found',
|
|
79
|
+
imsg_version: version,
|
|
80
|
+
binary_path: binaryPath,
|
|
81
|
+
full_disk_access: 'ok',
|
|
82
|
+
automation: 'unknown',
|
|
83
|
+
bridge: 'disabled',
|
|
84
|
+
test_chat: testChatResult,
|
|
85
|
+
warnings,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export const doctorCommand = new Command('doctor')
|
|
89
|
+
.description('Diagnose imsg availability and macOS permissions')
|
|
90
|
+
.option('--account <id>', 'Check a specific account (default: current)')
|
|
91
|
+
.option('--bin <path>', 'Check a specific imsg binary path')
|
|
92
|
+
.option('--region <code>', 'Default region for local-format phone numbers')
|
|
93
|
+
.option('--test-chat <chatId>', 'Send a test message to this chat id')
|
|
94
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
95
|
+
.action(async (opts) => {
|
|
96
|
+
const testChat = opts.testChat && /^\d+$/.test(opts.testChat) ? Number.parseInt(opts.testChat, 10) : undefined;
|
|
97
|
+
const report = await runDoctor({ account: opts.account, bin: opts.bin, region: opts.region, testChat });
|
|
98
|
+
console.log(formatOutput(report, opts.pretty));
|
|
99
|
+
process.exit(report.ok ? 0 : 1);
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAkBjE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAM/B;IACC,MAAM,QAAQ,GAAG,MAAM,IAAI,yBAAyB,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACtF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,IAAI,QAAQ,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,CAAA;IACnG,MAAM,MAAM,GAA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M,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,gBAAgB,EAAE,6CAA6C,CAAC;KACvE,MAAM,CAAC,cAAc,EAAE,mCAAmC,CAAC;KAC3D,MAAM,CAAC,iBAAiB,EAAE,+CAA+C,CAAC;KAC1E,MAAM,CAAC,sBAAsB,EAAE,qCAAqC,CAAC;KACrE,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,IAA8F,EAAE,EAAE;IAC/G,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9G,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IACvG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { authCommand } from './auth.js';
|
|
2
|
+
export { chatCommand } from './chat.js';
|
|
3
|
+
export { doctorCommand } from './doctor.js';
|
|
4
|
+
export { messageCommand } from './message.js';
|
|
5
|
+
export { setupCommand } from './setup.js';
|
|
6
|
+
export { whoamiCommand } from './whoami.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { authCommand } from './auth.js';
|
|
2
|
+
export { chatCommand } from './chat.js';
|
|
3
|
+
export { doctorCommand } from './doctor.js';
|
|
4
|
+
export { messageCommand } from './message.js';
|
|
5
|
+
export { setupCommand } from './setup.js';
|
|
6
|
+
export { whoamiCommand } from './whoami.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/imessage/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAoDnC,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM/D;AAmDD,eAAO,MAAM,cAAc,SAuCxB,CAAA;AAEH,OAAO,EAAE,UAAU,EAAE,CAAA"}
|