agent-messenger 2.36.1 → 2.37.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/plugin.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/kakaotalk/chat-classifier.d.ts +2 -1
- package/dist/src/platforms/kakaotalk/chat-classifier.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/chat-classifier.js +8 -6
- package/dist/src/platforms/kakaotalk/chat-classifier.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts +21 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +272 -32
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/index.d.ts +3 -3
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/index.js +2 -2
- package/dist/src/platforms/kakaotalk/index.js.map +1 -1
- package/dist/src/platforms/kakaotalk/types.d.ts +48 -2
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +13 -1
- package/dist/src/platforms/kakaotalk/types.js.map +1 -1
- package/docs/content/docs/cli/kakaotalk.mdx +7 -1
- package/docs/content/docs/sdk/kakaotalk.mdx +29 -1
- package/package.json +1 -1
- 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 +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-kakaotalk/references/common-patterns.md +36 -0
- 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 +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/platforms/kakaotalk/chat-classifier.test.ts +1 -1
- package/src/platforms/kakaotalk/chat-classifier.ts +10 -7
- package/src/platforms/kakaotalk/client.test.ts +593 -24
- package/src/platforms/kakaotalk/client.ts +337 -35
- package/src/platforms/kakaotalk/index.test.ts +12 -0
- package/src/platforms/kakaotalk/index.ts +7 -1
- package/src/platforms/kakaotalk/types.ts +33 -2
|
@@ -57,6 +57,17 @@ agent-kakaotalk message send "$TARGET_CHAT" "Hey Alice!"
|
|
|
57
57
|
|
|
58
58
|
> Note: `display_name` joins the chat's member nicknames. For the user-set room title (matching the KakaoTalk app), see [Pattern 10](#pattern-10-resolve-canonical-room-titles).
|
|
59
59
|
|
|
60
|
+
For an exact chat ID observed from a live event, the SDK can resolve that room
|
|
61
|
+
directly without depending on the login-time list:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const chat = await client.getChat('9876543210')
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`getChat()` uses the read-only `CHATINFO` owner. It preserves numeric room types
|
|
68
|
+
and open-chat types `OM` / `OD`; open chats without a `TITLE` meta use the
|
|
69
|
+
OpenLink name as a display-title fallback.
|
|
70
|
+
|
|
60
71
|
## Pattern 3: Send Files, Photos, Videos, and Audio
|
|
61
72
|
|
|
62
73
|
**Use case**: Upload an attachment to a chat (photo, video, voice, generic file, or multi-photo gallery)
|
|
@@ -187,6 +198,31 @@ NEW_MESSAGES=$(agent-kakaotalk message list "$CHAT_ID" --from "$LAST_SEEN")
|
|
|
187
198
|
|
|
188
199
|
**Pagination details**: The CLI prefers KakaoTalk's `MCHATLOGS` flow for history reads, fetching message batches from the requested `--from` point and returning the last N messages after deduplication and ascending sort. If that path cannot provide results, it reads the maximum log ID from the login chat-list watermark (`ll`, falling back to `l.logId`) and calls `SYNCMSG` directly only when that watermark is ahead of the current cursor. The history path never uses `CHATONROOM`, which avoids room-entry side effects. If the watermark is missing or is not ahead of the cursor, the fallback fails closed and returns `[]`. As a safety net, both message flows are capped at 50 internal pages. A warning is printed to stderr only when that cap is actually hit and the returned history may be incomplete.
|
|
189
200
|
|
|
201
|
+
For lossless forward-only SDK pagination, carry `next_cursor` into the next
|
|
202
|
+
exclusive `from` request until `complete` is true:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
let from = '123456789'
|
|
206
|
+
do {
|
|
207
|
+
const page = await client.getMessagePage(CHAT_ID, { from, count: 80 })
|
|
208
|
+
for (const message of page.messages) {
|
|
209
|
+
await archive(message)
|
|
210
|
+
}
|
|
211
|
+
if (page.complete) break
|
|
212
|
+
if (page.next_cursor === null) {
|
|
213
|
+
throw new Error('KakaoTalk history made no forward progress')
|
|
214
|
+
}
|
|
215
|
+
from = page.next_cursor
|
|
216
|
+
} while (true)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
`from` is exclusive. `next_cursor` is the last returned log ID, or `null` when
|
|
220
|
+
the server made no forward progress. `complete` is true only when the available
|
|
221
|
+
forward range is exhausted. The SDK prefers `MCHATLOGS`; for late rooms or an
|
|
222
|
+
empty page it reconciles with read-only `CHATINFO` and then calls `SYNCMSG` only
|
|
223
|
+
when the observed maximum log ID is ahead of `from`. This path does not call
|
|
224
|
+
`CHATONROOM`.
|
|
225
|
+
|
|
190
226
|
## Pattern 7: Multi-Chat Broadcast
|
|
191
227
|
|
|
192
228
|
**Use case**: Send the same message to multiple chats
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-webexbot
|
|
3
3
|
description: Interact with Cisco Webex using bot tokens - send messages, reply in threads, upload and download files, look up people, read spaces, manage memberships, stream real-time events
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.37.0
|
|
5
5
|
allowed-tools: Bash(agent-webexbot:*)
|
|
6
6
|
metadata:
|
|
7
7
|
openclaw:
|
|
@@ -19,7 +19,7 @@ describe('classifyKakaoChat', () => {
|
|
|
19
19
|
expect(classifyKakaoChat({ type: 10, active_members: 3 })).toBe('group')
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
-
for (const type of [2, 13, 14, 15, 16]) {
|
|
22
|
+
for (const type of [2, 13, 14, 15, 16, 'OM', 'OD'] as const) {
|
|
23
23
|
it(`classifies open-chat type ${type} as open regardless of member count`, () => {
|
|
24
24
|
expect(classifyKakaoChat({ type, active_members: 1 })).toBe('open')
|
|
25
25
|
expect(classifyKakaoChat({ type, active_members: 2 })).toBe('open')
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { KakaoChat } from './types'
|
|
1
|
+
import type { KakaoChat, KakaoOpenChatType } from './types'
|
|
2
2
|
|
|
3
3
|
export type KakaoChatKind = 'dm' | 'group' | 'open' | 'unknown'
|
|
4
4
|
|
|
5
|
-
// OpenChat-family `type`
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
// OpenChat-family `type` values observed on the wire. Login/chat-list data
|
|
6
|
+
// uses numeric codes while CHATINFO may return the protocol string tags
|
|
7
|
+
// `OM` / `OD`; both forms must share this single classification owner.
|
|
8
|
+
const OPEN_CHAT_TYPES: ReadonlySet<KakaoOpenChatType> = new Set([2, 13, 14, 15, 16, 'OM', 'OD'])
|
|
9
|
+
|
|
10
|
+
export function isOpenKakaoChatType(type: unknown): type is KakaoOpenChatType {
|
|
11
|
+
return OPEN_CHAT_TYPES.has(type as KakaoOpenChatType)
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Classify a KakaoTalk chat as `'dm'`, `'group'`, `'open'`, or `'unknown'`.
|
|
@@ -23,7 +26,7 @@ const OPEN_CHAT_TYPE_CODES: ReadonlySet<number> = new Set([2, 13, 14, 15, 16])
|
|
|
23
26
|
* the case defensively.
|
|
24
27
|
*/
|
|
25
28
|
export function classifyKakaoChat(chat: Pick<KakaoChat, 'type' | 'active_members'>): KakaoChatKind {
|
|
26
|
-
if (
|
|
29
|
+
if (isOpenKakaoChatType(chat.type)) return 'open'
|
|
27
30
|
// active_members counts the logged-in user, so a 1:1 DM is exactly 2
|
|
28
31
|
// (self + one other) and a "lone" room with only self is 1.
|
|
29
32
|
if (chat.active_members <= 2) return 'dm'
|