agent-messenger 2.11.2 → 2.12.1
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/CONTRIBUTING.md +12 -0
- package/README.md +41 -4
- 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/channeltalk/credential-manager.js +2 -2
- package/dist/src/platforms/channeltalk/credential-manager.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/credential-manager.js +2 -2
- package/dist/src/platforms/channeltalkbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/discord/credential-manager.js +2 -2
- package/dist/src/platforms/discord/credential-manager.js.map +1 -1
- package/dist/src/platforms/discordbot/credential-manager.js +2 -2
- package/dist/src/platforms/discordbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.js +2 -2
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +3 -4
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/credential-manager.js +2 -2
- package/dist/src/platforms/kakaotalk/credential-manager.js.map +1 -1
- package/dist/src/platforms/line/client.js +2 -2
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/credential-manager.js +2 -2
- package/dist/src/platforms/line/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/credential-manager.js +2 -2
- package/dist/src/platforms/slack/credential-manager.js.map +1 -1
- package/dist/src/platforms/slackbot/credential-manager.js +2 -2
- package/dist/src/platforms/slackbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/teams/credential-manager.js +2 -2
- package/dist/src/platforms/teams/credential-manager.js.map +1 -1
- package/dist/src/platforms/telegram/credential-manager.js +2 -2
- package/dist/src/platforms/telegram/credential-manager.js.map +1 -1
- package/dist/src/platforms/telegrambot/cli.d.ts +5 -0
- package/dist/src/platforms/telegrambot/cli.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/cli.js +29 -0
- package/dist/src/platforms/telegrambot/cli.js.map +1 -0
- package/dist/src/platforms/telegrambot/client.d.ts +85 -0
- package/dist/src/platforms/telegrambot/client.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/client.js +282 -0
- package/dist/src/platforms/telegrambot/client.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/auth.d.ts +31 -0
- package/dist/src/platforms/telegrambot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/auth.js +173 -0
- package/dist/src/platforms/telegrambot/commands/auth.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/chat.d.ts +25 -0
- package/dist/src/platforms/telegrambot/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/chat.js +69 -0
- package/dist/src/platforms/telegrambot/commands/chat.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/index.d.ts +6 -0
- package/dist/src/platforms/telegrambot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/index.js +6 -0
- package/dist/src/platforms/telegrambot/commands/index.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/message.d.ts +39 -0
- package/dist/src/platforms/telegrambot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/message.js +145 -0
- package/dist/src/platforms/telegrambot/commands/message.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/reaction.d.ts +16 -0
- package/dist/src/platforms/telegrambot/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/reaction.js +49 -0
- package/dist/src/platforms/telegrambot/commands/reaction.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/shared.d.ts +12 -0
- package/dist/src/platforms/telegrambot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/shared.js +21 -0
- package/dist/src/platforms/telegrambot/commands/shared.js.map +1 -0
- package/dist/src/platforms/telegrambot/commands/whoami.d.ts +17 -0
- package/dist/src/platforms/telegrambot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/commands/whoami.js +30 -0
- package/dist/src/platforms/telegrambot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/telegrambot/credential-manager.d.ts +17 -0
- package/dist/src/platforms/telegrambot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/credential-manager.js +113 -0
- package/dist/src/platforms/telegrambot/credential-manager.js.map +1 -0
- package/dist/src/platforms/telegrambot/index.d.ts +7 -0
- package/dist/src/platforms/telegrambot/index.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/index.js +5 -0
- package/dist/src/platforms/telegrambot/index.js.map +1 -0
- package/dist/src/platforms/telegrambot/listener.d.ts +30 -0
- package/dist/src/platforms/telegrambot/listener.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/listener.js +186 -0
- package/dist/src/platforms/telegrambot/listener.js.map +1 -0
- package/dist/src/platforms/telegrambot/types.d.ts +256 -0
- package/dist/src/platforms/telegrambot/types.d.ts.map +1 -0
- package/dist/src/platforms/telegrambot/types.js +96 -0
- package/dist/src/platforms/telegrambot/types.js.map +1 -0
- package/dist/src/platforms/webex/credential-manager.js +2 -2
- package/dist/src/platforms/webex/credential-manager.js.map +1 -1
- package/dist/src/platforms/wechatbot/credential-manager.js +2 -2
- package/dist/src/platforms/wechatbot/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js +2 -2
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsappbot/credential-manager.js +2 -2
- package/dist/src/platforms/whatsappbot/credential-manager.js.map +1 -1
- package/dist/src/shared/utils/config-dir.d.ts +14 -0
- package/dist/src/shared/utils/config-dir.d.ts.map +1 -0
- package/dist/src/shared/utils/config-dir.js +22 -0
- package/dist/src/shared/utils/config-dir.js.map +1 -0
- package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -1
- package/dist/src/shared/utils/derived-key-cache.js +2 -2
- package/dist/src/shared/utils/derived-key-cache.js.map +1 -1
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/telegrambot.mdx +149 -0
- package/docs/content/docs/index.mdx +10 -9
- package/docs/content/docs/quick-start.mdx +2 -0
- package/docs/content/docs/sdk/meta.json +1 -0
- package/docs/content/docs/sdk/telegrambot.mdx +216 -0
- package/e2e/config.ts +24 -0
- package/e2e/helpers.ts +1 -0
- package/e2e/telegrambot.e2e.test.ts +185 -0
- package/examples/telegrambot-listen.ts +54 -0
- package/package.json +10 -2
- package/scripts/postbuild.ts +1 -0
- 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-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +12 -5
- 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 +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +357 -0
- package/skills/agent-webex/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/channeltalk/credential-manager.ts +2 -2
- package/src/platforms/channeltalkbot/credential-manager.ts +2 -2
- package/src/platforms/discord/credential-manager.ts +3 -2
- package/src/platforms/discordbot/credential-manager.ts +2 -2
- package/src/platforms/instagram/credential-manager.ts +2 -2
- package/src/platforms/kakaotalk/client.ts +3 -5
- package/src/platforms/kakaotalk/credential-manager.ts +2 -2
- package/src/platforms/line/client.ts +2 -2
- package/src/platforms/line/credential-manager.ts +2 -2
- package/src/platforms/slack/credential-manager.ts +2 -2
- package/src/platforms/slackbot/credential-manager.ts +2 -2
- package/src/platforms/teams/credential-manager.ts +2 -2
- package/src/platforms/telegram/commands/whoami.test.ts +1 -0
- package/src/platforms/telegram/credential-manager.ts +2 -2
- package/src/platforms/telegrambot/cli.ts +34 -0
- package/src/platforms/telegrambot/client.test.ts +454 -0
- package/src/platforms/telegrambot/client.ts +404 -0
- package/src/platforms/telegrambot/commands/auth.test.ts +244 -0
- package/src/platforms/telegrambot/commands/auth.ts +220 -0
- package/src/platforms/telegrambot/commands/chat.ts +96 -0
- package/src/platforms/telegrambot/commands/index.ts +5 -0
- package/src/platforms/telegrambot/commands/message.ts +235 -0
- package/src/platforms/telegrambot/commands/reaction.ts +70 -0
- package/src/platforms/telegrambot/commands/shared.ts +32 -0
- package/src/platforms/telegrambot/commands/whoami.ts +45 -0
- package/src/platforms/telegrambot/credential-manager.test.ts +196 -0
- package/src/platforms/telegrambot/credential-manager.ts +141 -0
- package/src/platforms/telegrambot/index.ts +44 -0
- package/src/platforms/telegrambot/listener.test.ts +398 -0
- package/src/platforms/telegrambot/listener.ts +198 -0
- package/src/platforms/telegrambot/types.test.ts +128 -0
- package/src/platforms/telegrambot/types.ts +282 -0
- package/src/platforms/webex/credential-manager.ts +2 -2
- package/src/platforms/wechatbot/credential-manager.ts +2 -2
- package/src/platforms/whatsapp/credential-manager.ts +2 -2
- package/src/platforms/whatsappbot/credential-manager.ts +2 -2
- package/src/shared/utils/config-dir.test.ts +41 -0
- package/src/shared/utils/config-dir.ts +23 -0
- package/src/shared/utils/derived-key-cache.ts +3 -2
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { afterEach, beforeAll, describe, expect, it } from 'bun:test'
|
|
2
|
+
|
|
3
|
+
import { TELEGRAMBOT_TEST_CHAT_ID, validateTelegramBotEnvironment } from './config'
|
|
4
|
+
import { generateTestId, parseJSON, runCLI, waitForRateLimit } from './helpers'
|
|
5
|
+
|
|
6
|
+
let telegramBotAvailable = false
|
|
7
|
+
let trackedMessageIds: number[] = []
|
|
8
|
+
|
|
9
|
+
async function deleteTrackedMessages(): Promise<void> {
|
|
10
|
+
for (const messageId of trackedMessageIds) {
|
|
11
|
+
try {
|
|
12
|
+
await runCLI('telegrambot', ['message', 'delete', TELEGRAMBOT_TEST_CHAT_ID, String(messageId), '--force'])
|
|
13
|
+
await waitForRateLimit(300)
|
|
14
|
+
} catch {
|
|
15
|
+
// best-effort cleanup
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
trackedMessageIds = []
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe('Telegram Bot E2E Tests', () => {
|
|
22
|
+
beforeAll(async () => {
|
|
23
|
+
telegramBotAvailable = await validateTelegramBotEnvironment()
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
afterEach(async () => {
|
|
27
|
+
if (trackedMessageIds.length > 0) {
|
|
28
|
+
await deleteTrackedMessages()
|
|
29
|
+
}
|
|
30
|
+
await waitForRateLimit()
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
describe('auth', () => {
|
|
34
|
+
it('auth status returns valid bot info', async () => {
|
|
35
|
+
if (!telegramBotAvailable) return
|
|
36
|
+
|
|
37
|
+
const result = await runCLI('telegrambot', ['auth', 'status'])
|
|
38
|
+
expect(result.exitCode).toBe(0)
|
|
39
|
+
|
|
40
|
+
const data = parseJSON<{ valid: boolean; bot_id: string }>(result.stdout)
|
|
41
|
+
expect(data?.valid).toBe(true)
|
|
42
|
+
expect(data?.bot_id).toBeTruthy()
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('auth list returns bots array', async () => {
|
|
46
|
+
if (!telegramBotAvailable) return
|
|
47
|
+
|
|
48
|
+
const result = await runCLI('telegrambot', ['auth', 'list'])
|
|
49
|
+
expect(result.exitCode).toBe(0)
|
|
50
|
+
|
|
51
|
+
const data = parseJSON<{ bots: Array<{ bot_id: string }> }>(result.stdout)
|
|
52
|
+
expect(Array.isArray(data?.bots)).toBe(true)
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
describe('whoami', () => {
|
|
57
|
+
it('whoami returns bot identity', async () => {
|
|
58
|
+
if (!telegramBotAvailable) return
|
|
59
|
+
|
|
60
|
+
const result = await runCLI('telegrambot', ['whoami'])
|
|
61
|
+
expect(result.exitCode).toBe(0)
|
|
62
|
+
|
|
63
|
+
const data = parseJSON<{ id: number; is_bot: boolean }>(result.stdout)
|
|
64
|
+
expect(data?.id).toBeTruthy()
|
|
65
|
+
expect(data?.is_bot).toBe(true)
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('chat', () => {
|
|
70
|
+
it('chat info returns chat details', async () => {
|
|
71
|
+
if (!telegramBotAvailable) return
|
|
72
|
+
|
|
73
|
+
const result = await runCLI('telegrambot', ['chat', 'info', TELEGRAMBOT_TEST_CHAT_ID])
|
|
74
|
+
expect(result.exitCode).toBe(0)
|
|
75
|
+
|
|
76
|
+
const data = parseJSON<{ id: number; type: string }>(result.stdout)
|
|
77
|
+
expect(data?.id).toBeTruthy()
|
|
78
|
+
expect(data?.type).toBeTruthy()
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('message', () => {
|
|
83
|
+
it('message send delivers message and returns id', async () => {
|
|
84
|
+
if (!telegramBotAvailable) return
|
|
85
|
+
|
|
86
|
+
const testId = generateTestId()
|
|
87
|
+
const result = await runCLI('telegrambot', ['message', 'send', TELEGRAMBOT_TEST_CHAT_ID, `Bot e2e ${testId}`])
|
|
88
|
+
expect(result.exitCode).toBe(0)
|
|
89
|
+
|
|
90
|
+
const data = parseJSON<{ message: { message_id: number; chat_id: number; text: string } }>(result.stdout)
|
|
91
|
+
expect(data?.message?.message_id).toBeTruthy()
|
|
92
|
+
expect(data?.message?.text).toContain(testId)
|
|
93
|
+
if (data?.message?.message_id) trackedMessageIds.push(data.message.message_id)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('message update edits previously sent message', async () => {
|
|
97
|
+
if (!telegramBotAvailable) return
|
|
98
|
+
|
|
99
|
+
const testId = generateTestId()
|
|
100
|
+
const sendResult = await runCLI('telegrambot', [
|
|
101
|
+
'message',
|
|
102
|
+
'send',
|
|
103
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
104
|
+
`Original ${testId}`,
|
|
105
|
+
])
|
|
106
|
+
const sent = parseJSON<{ message: { message_id: number } }>(sendResult.stdout)
|
|
107
|
+
expect(sent?.message?.message_id).toBeTruthy()
|
|
108
|
+
if (sent?.message?.message_id) trackedMessageIds.push(sent.message.message_id)
|
|
109
|
+
|
|
110
|
+
await waitForRateLimit()
|
|
111
|
+
|
|
112
|
+
const updateResult = await runCLI('telegrambot', [
|
|
113
|
+
'message',
|
|
114
|
+
'update',
|
|
115
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
116
|
+
String(sent!.message.message_id),
|
|
117
|
+
`Edited ${testId}`,
|
|
118
|
+
])
|
|
119
|
+
expect(updateResult.exitCode).toBe(0)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('message delete removes message', async () => {
|
|
123
|
+
if (!telegramBotAvailable) return
|
|
124
|
+
|
|
125
|
+
const testId = generateTestId()
|
|
126
|
+
const sendResult = await runCLI('telegrambot', [
|
|
127
|
+
'message',
|
|
128
|
+
'send',
|
|
129
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
130
|
+
`Delete me ${testId}`,
|
|
131
|
+
])
|
|
132
|
+
const sent = parseJSON<{ message: { message_id: number } }>(sendResult.stdout)
|
|
133
|
+
expect(sent?.message?.message_id).toBeTruthy()
|
|
134
|
+
|
|
135
|
+
await waitForRateLimit()
|
|
136
|
+
|
|
137
|
+
const deleteResult = await runCLI('telegrambot', [
|
|
138
|
+
'message',
|
|
139
|
+
'delete',
|
|
140
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
141
|
+
String(sent!.message.message_id),
|
|
142
|
+
'--force',
|
|
143
|
+
])
|
|
144
|
+
expect(deleteResult.exitCode).toBe(0)
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
describe('reaction', () => {
|
|
149
|
+
it('reaction set and clear lifecycle', async () => {
|
|
150
|
+
if (!telegramBotAvailable) return
|
|
151
|
+
|
|
152
|
+
const testId = generateTestId()
|
|
153
|
+
const sendResult = await runCLI('telegrambot', [
|
|
154
|
+
'message',
|
|
155
|
+
'send',
|
|
156
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
157
|
+
`Reaction test ${testId}`,
|
|
158
|
+
])
|
|
159
|
+
const sent = parseJSON<{ message: { message_id: number } }>(sendResult.stdout)
|
|
160
|
+
expect(sent?.message?.message_id).toBeTruthy()
|
|
161
|
+
if (sent?.message?.message_id) trackedMessageIds.push(sent.message.message_id)
|
|
162
|
+
|
|
163
|
+
await waitForRateLimit(2000)
|
|
164
|
+
|
|
165
|
+
const setResult = await runCLI('telegrambot', [
|
|
166
|
+
'reaction',
|
|
167
|
+
'set',
|
|
168
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
169
|
+
String(sent!.message.message_id),
|
|
170
|
+
'👍',
|
|
171
|
+
])
|
|
172
|
+
expect(setResult.exitCode).toBe(0)
|
|
173
|
+
|
|
174
|
+
await waitForRateLimit(2000)
|
|
175
|
+
|
|
176
|
+
const clearResult = await runCLI('telegrambot', [
|
|
177
|
+
'reaction',
|
|
178
|
+
'clear',
|
|
179
|
+
TELEGRAMBOT_TEST_CHAT_ID,
|
|
180
|
+
String(sent!.message.message_id),
|
|
181
|
+
])
|
|
182
|
+
expect(clearResult.exitCode).toBe(0)
|
|
183
|
+
}, 15000)
|
|
184
|
+
})
|
|
185
|
+
})
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Run `agent-telegrambot auth set <token>` first so login() can pick up stored creds.
|
|
3
|
+
import { TelegramBotClient } from '../src/platforms/telegrambot/client'
|
|
4
|
+
import { TelegramBotListener } from '../src/platforms/telegrambot/listener'
|
|
5
|
+
|
|
6
|
+
async function main() {
|
|
7
|
+
const client = await new TelegramBotClient().login()
|
|
8
|
+
|
|
9
|
+
const listener = new TelegramBotListener(client, {
|
|
10
|
+
allowedUpdates: ['message', 'edited_message', 'callback_query', 'my_chat_member'],
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
listener.on('connected', ({ user }) => {
|
|
14
|
+
console.log(`Connected as @${user.username ?? user.first_name} (id: ${user.id})`)
|
|
15
|
+
console.log('Listening for events. Press Ctrl+C to stop.\n')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
listener.on('disconnected', () => {
|
|
19
|
+
console.log('[disconnected] retrying...')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
listener.on('message', (message) => {
|
|
23
|
+
if (message.from?.is_bot) return
|
|
24
|
+
const time = new Date(message.date * 1000).toLocaleTimeString()
|
|
25
|
+
const sender = message.from?.username ?? message.from?.first_name ?? 'unknown'
|
|
26
|
+
console.log(`[${time}] message in ${message.chat.id} <${sender}>: ${message.text ?? '(non-text)'}`)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
listener.on('edited_message', (message) => {
|
|
30
|
+
console.log(`[edit] message ${message.message_id} in ${message.chat.id}`)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
listener.on('callback_query', (query) => {
|
|
34
|
+
console.log(`[callback] data=${query.data ?? '(none)'} from ${query.from.username ?? query.from.id}`)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
listener.on('my_chat_member', (event) => {
|
|
38
|
+
console.log(`[my_chat_member] ${event.chat.id}: ${event.old_chat_member.status} -> ${event.new_chat_member.status}`)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
listener.on('error', (err) => {
|
|
42
|
+
console.error(`[error] ${err.message}`)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
process.on('SIGINT', () => {
|
|
46
|
+
console.log('\nStopping...')
|
|
47
|
+
listener.stop()
|
|
48
|
+
process.exit(130)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
await listener.start()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
main()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-messenger",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, Instagram, KakaoTalk, Channel Talk)",
|
|
3
|
+
"version": "2.12.1",
|
|
4
|
+
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams, Webex, Telegram, Telegram Bot, WhatsApp, LINE, Instagram, KakaoTalk, Channel Talk)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/agent-messenger/agent-messenger"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"agent-slackbot": "dist/src/platforms/slackbot/cli.js",
|
|
20
20
|
"agent-teams": "dist/src/platforms/teams/cli.js",
|
|
21
21
|
"agent-telegram": "dist/src/platforms/telegram/cli.js",
|
|
22
|
+
"agent-telegrambot": "dist/src/platforms/telegrambot/cli.js",
|
|
22
23
|
"agent-webex": "dist/src/platforms/webex/cli.js",
|
|
23
24
|
"agent-wechatbot": "dist/src/platforms/wechatbot/cli.js",
|
|
24
25
|
"agent-whatsapp": "dist/src/platforms/whatsapp/cli.js",
|
|
@@ -71,6 +72,9 @@
|
|
|
71
72
|
],
|
|
72
73
|
"channeltalkbot": [
|
|
73
74
|
"./dist/src/platforms/channeltalkbot/index.d.ts"
|
|
75
|
+
],
|
|
76
|
+
"telegrambot": [
|
|
77
|
+
"./dist/src/platforms/telegrambot/index.d.ts"
|
|
74
78
|
]
|
|
75
79
|
}
|
|
76
80
|
},
|
|
@@ -135,6 +139,10 @@
|
|
|
135
139
|
"./channeltalkbot": {
|
|
136
140
|
"types": "./dist/src/platforms/channeltalkbot/index.d.ts",
|
|
137
141
|
"default": "./dist/src/platforms/channeltalkbot/index.js"
|
|
142
|
+
},
|
|
143
|
+
"./telegrambot": {
|
|
144
|
+
"types": "./dist/src/platforms/telegrambot/index.d.ts",
|
|
145
|
+
"default": "./dist/src/platforms/telegrambot/index.js"
|
|
138
146
|
}
|
|
139
147
|
},
|
|
140
148
|
"scripts": {
|
package/scripts/postbuild.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-channeltalk
|
|
3
3
|
description: Interact with Channel Talk using extracted desktop app or browser credentials - read chats, send messages, search messages, manage groups
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.12.1
|
|
5
5
|
allowed-tools: Bash(agent-channeltalk:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-kakaotalk
|
|
3
3
|
description: Interact with KakaoTalk - send messages, read chats, manage conversations
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.12.1
|
|
5
5
|
allowed-tools: Bash(agent-kakaotalk:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -56,7 +56,7 @@ Registers the CLI as a sub-device (tablet slot by default). Your desktop app kee
|
|
|
56
56
|
agent-kakaotalk auth login
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
In interactive mode, this prompts for email and password.
|
|
59
|
+
In interactive mode, this prompts for email and password. On macOS and Windows, the CLI first tries to extract cached credentials from the desktop app so you may not need to type anything. On Linux there is no desktop app, so always pass credentials explicitly via `--email` and `--password` (or `--password-file`).
|
|
60
60
|
|
|
61
61
|
For AI agents (non-interactive), provide credentials via flags:
|
|
62
62
|
|
|
@@ -488,8 +488,7 @@ See the [KakaoTalk SDK documentation](https://agent-messenger.dev/docs/sdk/kakao
|
|
|
488
488
|
|
|
489
489
|
## Limitations
|
|
490
490
|
|
|
491
|
-
- macOS and Windows only (desktop
|
|
492
|
-
- No Linux support (KakaoTalk desktop not available on Linux)
|
|
491
|
+
- Auto-extraction of email/password from the desktop app is **macOS and Windows only** (KakaoTalk desktop is not available on Linux). Linux users must pass `--email` and `--password` (or `--password-file`) explicitly — the LOCO protocol, login flow, and all messaging features work on Linux.
|
|
493
492
|
- No file upload or download
|
|
494
493
|
- No channel/chat room creation or management
|
|
495
494
|
- No friend list management
|
|
@@ -526,7 +525,15 @@ pnpm dlx --package agent-messenger agent-kakaotalk chat list --pretty
|
|
|
526
525
|
|
|
527
526
|
### Password prompt on fresh install
|
|
528
527
|
|
|
529
|
-
On fresh installs, the desktop app (macOS or Windows) may hash or omit the password from its cache, so the CLI cannot extract it automatically. The CLI will prompt for the password once to register the device — via a native dialog on macOS (AppKit)
|
|
528
|
+
On fresh installs, the desktop app (macOS or Windows) may hash or omit the password from its cache, so the CLI cannot extract it automatically. The CLI will prompt for the password once to register the device — via a native dialog on macOS (AppKit), Windows (PowerShell WinForms), or Linux (`zenity` / `kdialog`), or via a TTY prompt if a terminal is available. After registration, the password is never needed again.
|
|
529
|
+
|
|
530
|
+
On Linux there is no desktop app to extract from, so always provide credentials explicitly:
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
agent-kakaotalk auth login --email user@example.com --password-file /tmp/.kakao-pw
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
`--password-file` reads the file then immediately deletes it, so the password never appears in shell history or process listings.
|
|
530
537
|
|
|
531
538
|
When the CLI returns `{"next_action": "run_interactive", ...}`, use a tmux session to let the user type their password securely. See "Handling `run_interactive`" above for the exact steps.
|
|
532
539
|
|