agent-messenger 2.10.0 → 2.10.2

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.
Files changed (239) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/package.json +1 -1
  3. package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
  4. package/dist/src/platforms/teams/token-extractor.js +15 -2
  5. package/dist/src/platforms/teams/token-extractor.js.map +1 -1
  6. package/dist/src/shared/chromium/decryptor.d.ts +6 -0
  7. package/dist/src/shared/chromium/decryptor.d.ts.map +1 -1
  8. package/dist/src/shared/chromium/decryptor.js +26 -6
  9. package/dist/src/shared/chromium/decryptor.js.map +1 -1
  10. package/e2e/channeltalk.e2e.test.ts +13 -13
  11. package/e2e/channeltalkbot.e2e.test.ts +13 -13
  12. package/e2e/discord.e2e.test.ts +24 -24
  13. package/e2e/discordbot.e2e.test.ts +16 -16
  14. package/e2e/instagram.e2e.test.ts +10 -10
  15. package/e2e/kakaotalk.e2e.test.ts +7 -7
  16. package/e2e/line.e2e.test.ts +8 -8
  17. package/e2e/slack.e2e.test.ts +34 -34
  18. package/e2e/slackbot.e2e.test.ts +14 -14
  19. package/e2e/teams.e2e.test.ts +23 -23
  20. package/e2e/telegram.e2e.test.ts +8 -8
  21. package/e2e/webex.e2e.test.ts +14 -14
  22. package/e2e/whatsapp.e2e.test.ts +8 -8
  23. package/e2e/whatsappbot.e2e.test.ts +6 -6
  24. package/package.json +1 -1
  25. package/skills/agent-channeltalk/SKILL.md +1 -1
  26. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  27. package/skills/agent-discord/SKILL.md +1 -1
  28. package/skills/agent-discordbot/SKILL.md +1 -1
  29. package/skills/agent-instagram/SKILL.md +1 -1
  30. package/skills/agent-kakaotalk/SKILL.md +1 -1
  31. package/skills/agent-line/SKILL.md +1 -1
  32. package/skills/agent-slack/SKILL.md +1 -1
  33. package/skills/agent-slackbot/SKILL.md +1 -1
  34. package/skills/agent-teams/SKILL.md +1 -1
  35. package/skills/agent-telegram/SKILL.md +1 -1
  36. package/skills/agent-webex/SKILL.md +1 -1
  37. package/skills/agent-wechatbot/SKILL.md +1 -1
  38. package/skills/agent-whatsapp/SKILL.md +1 -1
  39. package/skills/agent-whatsappbot/SKILL.md +1 -1
  40. package/src/platforms/channeltalk/client.test.ts +26 -26
  41. package/src/platforms/channeltalk/commands/auth.test.ts +16 -16
  42. package/src/platforms/channeltalk/commands/bot.test.ts +2 -2
  43. package/src/platforms/channeltalk/commands/chat.test.ts +3 -3
  44. package/src/platforms/channeltalk/commands/group.test.ts +4 -4
  45. package/src/platforms/channeltalk/commands/manager.test.ts +2 -2
  46. package/src/platforms/channeltalk/commands/message.test.ts +17 -17
  47. package/src/platforms/channeltalk/commands/snapshot.test.ts +7 -7
  48. package/src/platforms/channeltalk/commands/whoami.test.ts +3 -3
  49. package/src/platforms/channeltalk/credential-manager.test.ts +18 -18
  50. package/src/platforms/channeltalk/ensure-auth.test.ts +5 -5
  51. package/src/platforms/channeltalk/index.test.ts +23 -23
  52. package/src/platforms/channeltalk/token-extractor.test.ts +21 -21
  53. package/src/platforms/channeltalk/types.test.ts +12 -12
  54. package/src/platforms/channeltalkbot/client.test.ts +14 -14
  55. package/src/platforms/channeltalkbot/commands/auth.test.ts +16 -16
  56. package/src/platforms/channeltalkbot/commands/bot.test.ts +6 -6
  57. package/src/platforms/channeltalkbot/commands/chat.test.ts +9 -9
  58. package/src/platforms/channeltalkbot/commands/group.test.ts +6 -6
  59. package/src/platforms/channeltalkbot/commands/manager.test.ts +3 -3
  60. package/src/platforms/channeltalkbot/commands/message.test.ts +10 -10
  61. package/src/platforms/channeltalkbot/commands/snapshot.test.ts +7 -7
  62. package/src/platforms/channeltalkbot/commands/whoami.test.ts +4 -4
  63. package/src/platforms/channeltalkbot/credential-manager.test.ts +27 -27
  64. package/src/platforms/channeltalkbot/index.test.ts +15 -15
  65. package/src/platforms/discord/client.test.ts +28 -28
  66. package/src/platforms/discord/commands/auth.test.ts +7 -7
  67. package/src/platforms/discord/commands/channel.test.ts +7 -7
  68. package/src/platforms/discord/commands/dm.test.ts +4 -4
  69. package/src/platforms/discord/commands/file.test.ts +4 -4
  70. package/src/platforms/discord/commands/friend.test.ts +6 -6
  71. package/src/platforms/discord/commands/member.test.ts +5 -5
  72. package/src/platforms/discord/commands/mention.test.ts +5 -5
  73. package/src/platforms/discord/commands/message.test.ts +9 -9
  74. package/src/platforms/discord/commands/note.test.ts +6 -6
  75. package/src/platforms/discord/commands/profile.test.ts +4 -4
  76. package/src/platforms/discord/commands/reaction.test.ts +5 -5
  77. package/src/platforms/discord/commands/server.test.ts +7 -7
  78. package/src/platforms/discord/commands/snapshot.test.ts +6 -6
  79. package/src/platforms/discord/commands/thread.test.ts +6 -6
  80. package/src/platforms/discord/commands/user.test.ts +5 -5
  81. package/src/platforms/discord/commands/whoami.test.ts +6 -6
  82. package/src/platforms/discord/credential-manager.test.ts +16 -16
  83. package/src/platforms/discord/ensure-auth.test.ts +8 -8
  84. package/src/platforms/discord/index.test.ts +17 -17
  85. package/src/platforms/discord/listener.test.ts +33 -33
  86. package/src/platforms/discord/token-extractor.test.ts +53 -53
  87. package/src/platforms/discord/types.test.ts +26 -26
  88. package/src/platforms/discordbot/client.test.ts +31 -31
  89. package/src/platforms/discordbot/commands/auth.test.ts +18 -18
  90. package/src/platforms/discordbot/commands/channel.test.ts +11 -11
  91. package/src/platforms/discordbot/commands/file.test.ts +7 -7
  92. package/src/platforms/discordbot/commands/message.test.ts +25 -25
  93. package/src/platforms/discordbot/commands/reaction.test.ts +6 -6
  94. package/src/platforms/discordbot/commands/server.test.ts +12 -12
  95. package/src/platforms/discordbot/commands/snapshot.test.ts +13 -13
  96. package/src/platforms/discordbot/commands/thread.test.ts +10 -10
  97. package/src/platforms/discordbot/commands/user.test.ts +9 -9
  98. package/src/platforms/discordbot/commands/whoami.test.ts +4 -4
  99. package/src/platforms/discordbot/credential-manager.test.ts +28 -28
  100. package/src/platforms/instagram/client.test.ts +18 -18
  101. package/src/platforms/instagram/commands/auth.test.ts +11 -11
  102. package/src/platforms/instagram/commands/chat.test.ts +6 -6
  103. package/src/platforms/instagram/commands/message.test.ts +11 -11
  104. package/src/platforms/instagram/commands/shared.test.ts +12 -12
  105. package/src/platforms/instagram/commands/whoami.test.ts +3 -3
  106. package/src/platforms/instagram/credential-manager.test.ts +21 -21
  107. package/src/platforms/instagram/ensure-auth.test.ts +4 -4
  108. package/src/platforms/instagram/index.test.ts +9 -9
  109. package/src/platforms/instagram/listener.test.ts +8 -8
  110. package/src/platforms/instagram/token-extractor.test.ts +35 -35
  111. package/src/platforms/kakaotalk/client.test.ts +33 -33
  112. package/src/platforms/kakaotalk/commands/auth.test.ts +11 -11
  113. package/src/platforms/kakaotalk/commands/chat.test.ts +6 -6
  114. package/src/platforms/kakaotalk/commands/message.test.ts +7 -7
  115. package/src/platforms/kakaotalk/commands/whoami.test.ts +5 -5
  116. package/src/platforms/kakaotalk/credential-manager.test.ts +15 -15
  117. package/src/platforms/kakaotalk/index.test.ts +15 -15
  118. package/src/platforms/kakaotalk/listener.test.ts +17 -17
  119. package/src/platforms/line/client.test.ts +17 -17
  120. package/src/platforms/line/commands/auth.test.ts +8 -8
  121. package/src/platforms/line/commands/chat.test.ts +7 -7
  122. package/src/platforms/line/commands/friend.test.ts +6 -6
  123. package/src/platforms/line/commands/message.test.ts +7 -7
  124. package/src/platforms/line/commands/whoami.test.ts +6 -6
  125. package/src/platforms/line/credential-manager.test.ts +17 -17
  126. package/src/platforms/line/index.test.ts +10 -10
  127. package/src/platforms/line/listener.test.ts +15 -15
  128. package/src/platforms/line/types.test.ts +14 -14
  129. package/src/platforms/slack/cli.test.ts +8 -8
  130. package/src/platforms/slack/client.test.ts +151 -151
  131. package/src/platforms/slack/commands/activity.test.ts +13 -13
  132. package/src/platforms/slack/commands/auth.test.ts +34 -34
  133. package/src/platforms/slack/commands/bookmark.test.ts +9 -9
  134. package/src/platforms/slack/commands/channel.test.ts +17 -17
  135. package/src/platforms/slack/commands/drafts.test.ts +7 -7
  136. package/src/platforms/slack/commands/emoji.test.ts +3 -3
  137. package/src/platforms/slack/commands/file.test.ts +12 -12
  138. package/src/platforms/slack/commands/message.test.ts +19 -19
  139. package/src/platforms/slack/commands/pin.test.ts +7 -7
  140. package/src/platforms/slack/commands/reaction.test.ts +10 -10
  141. package/src/platforms/slack/commands/reminder.test.ts +9 -9
  142. package/src/platforms/slack/commands/saved.test.ts +7 -7
  143. package/src/platforms/slack/commands/sections.test.ts +5 -5
  144. package/src/platforms/slack/commands/snapshot.test.ts +13 -13
  145. package/src/platforms/slack/commands/unread.test.ts +6 -6
  146. package/src/platforms/slack/commands/user.test.ts +10 -10
  147. package/src/platforms/slack/commands/usergroup.test.ts +15 -15
  148. package/src/platforms/slack/commands/whoami.test.ts +6 -6
  149. package/src/platforms/slack/commands/workspace.test.ts +26 -26
  150. package/src/platforms/slack/credential-manager.test.ts +14 -14
  151. package/src/platforms/slack/ensure-auth.test.ts +21 -21
  152. package/src/platforms/slack/index.test.ts +12 -12
  153. package/src/platforms/slack/listener.test.ts +17 -17
  154. package/src/platforms/slack/token-extractor-node.test.ts +2 -2
  155. package/src/platforms/slack/token-extractor.test.ts +37 -37
  156. package/src/platforms/slack/types.test.ts +21 -21
  157. package/src/platforms/slackbot/client.test.ts +22 -22
  158. package/src/platforms/slackbot/commands/auth.test.ts +14 -14
  159. package/src/platforms/slackbot/commands/channel.test.ts +7 -7
  160. package/src/platforms/slackbot/commands/message.test.ts +13 -13
  161. package/src/platforms/slackbot/commands/reaction.test.ts +6 -6
  162. package/src/platforms/slackbot/commands/user.test.ts +7 -7
  163. package/src/platforms/slackbot/commands/whoami.test.ts +4 -4
  164. package/src/platforms/slackbot/credential-manager.test.ts +22 -22
  165. package/src/platforms/slackbot/types.test.ts +7 -7
  166. package/src/platforms/teams/client.test.ts +30 -30
  167. package/src/platforms/teams/commands/auth.test.ts +8 -8
  168. package/src/platforms/teams/commands/channel.test.ts +7 -7
  169. package/src/platforms/teams/commands/file.test.ts +4 -4
  170. package/src/platforms/teams/commands/message.test.ts +5 -5
  171. package/src/platforms/teams/commands/reaction.test.ts +4 -4
  172. package/src/platforms/teams/commands/snapshot.test.ts +7 -7
  173. package/src/platforms/teams/commands/team.test.ts +8 -8
  174. package/src/platforms/teams/commands/user.test.ts +4 -4
  175. package/src/platforms/teams/commands/whoami.test.ts +6 -6
  176. package/src/platforms/teams/credential-manager.test.ts +17 -17
  177. package/src/platforms/teams/ensure-auth.test.ts +13 -13
  178. package/src/platforms/teams/index.test.ts +15 -15
  179. package/src/platforms/teams/token-extractor.test.ts +219 -145
  180. package/src/platforms/teams/token-extractor.ts +13 -2
  181. package/src/platforms/teams/types.test.ts +26 -26
  182. package/src/platforms/telegram/app-config.test.ts +4 -4
  183. package/src/platforms/telegram/chat-utils.test.ts +12 -12
  184. package/src/platforms/telegram/client.test.ts +4 -4
  185. package/src/platforms/telegram/commands/auth.test.ts +16 -16
  186. package/src/platforms/telegram/commands/chat.test.ts +9 -9
  187. package/src/platforms/telegram/commands/message.test.ts +6 -6
  188. package/src/platforms/telegram/commands/shared.test.ts +3 -3
  189. package/src/platforms/telegram/commands/whoami.test.ts +3 -3
  190. package/src/platforms/telegram/credential-manager.test.ts +10 -10
  191. package/src/platforms/telegram/types.test.ts +6 -6
  192. package/src/platforms/webex/app-config.test.ts +8 -8
  193. package/src/platforms/webex/cli.test.ts +5 -5
  194. package/src/platforms/webex/client.test.ts +65 -65
  195. package/src/platforms/webex/commands/auth.test.ts +18 -18
  196. package/src/platforms/webex/commands/member.test.ts +5 -5
  197. package/src/platforms/webex/commands/message.test.ts +12 -12
  198. package/src/platforms/webex/commands/snapshot.test.ts +5 -5
  199. package/src/platforms/webex/commands/space.test.ts +10 -10
  200. package/src/platforms/webex/commands/whoami.test.ts +6 -6
  201. package/src/platforms/webex/credential-manager.test.ts +22 -22
  202. package/src/platforms/webex/encryption.test.ts +4 -4
  203. package/src/platforms/webex/ensure-auth.test.ts +5 -5
  204. package/src/platforms/webex/index.test.ts +5 -5
  205. package/src/platforms/webex/markdown-to-html.test.ts +33 -33
  206. package/src/platforms/webex/token-extractor.test.ts +23 -23
  207. package/src/platforms/webex/types.test.ts +27 -27
  208. package/src/platforms/wechatbot/client.test.ts +27 -27
  209. package/src/platforms/wechatbot/commands/auth.test.ts +15 -15
  210. package/src/platforms/wechatbot/commands/message.test.ts +8 -8
  211. package/src/platforms/wechatbot/commands/template.test.ts +9 -9
  212. package/src/platforms/wechatbot/commands/user.test.ts +7 -7
  213. package/src/platforms/wechatbot/commands/whoami.test.ts +5 -5
  214. package/src/platforms/wechatbot/credential-manager.test.ts +18 -18
  215. package/src/platforms/wechatbot/index.test.ts +10 -10
  216. package/src/platforms/wechatbot/types.test.ts +25 -25
  217. package/src/platforms/whatsapp/commands/auth.test.ts +13 -13
  218. package/src/platforms/whatsapp/commands/chat.test.ts +8 -8
  219. package/src/platforms/whatsapp/commands/message.test.ts +10 -10
  220. package/src/platforms/whatsapp/commands/whoami.test.ts +3 -3
  221. package/src/platforms/whatsapp/credential-manager.test.ts +23 -23
  222. package/src/platforms/whatsapp/ensure-auth.test.ts +4 -4
  223. package/src/platforms/whatsapp/index.test.ts +8 -8
  224. package/src/platforms/whatsapp/types.test.ts +42 -42
  225. package/src/platforms/whatsappbot/client.test.ts +27 -27
  226. package/src/platforms/whatsappbot/commands/auth.test.ts +14 -14
  227. package/src/platforms/whatsappbot/commands/message.test.ts +16 -16
  228. package/src/platforms/whatsappbot/commands/template.test.ts +9 -9
  229. package/src/platforms/whatsappbot/commands/whoami.test.ts +5 -5
  230. package/src/platforms/whatsappbot/credential-manager.test.ts +18 -18
  231. package/src/platforms/whatsappbot/index.test.ts +7 -7
  232. package/src/platforms/whatsappbot/types.test.ts +18 -18
  233. package/src/shared/chromium/browsers.test.ts +22 -22
  234. package/src/shared/chromium/cookie-reader.test.ts +13 -13
  235. package/src/shared/chromium/decryptor.test.ts +97 -32
  236. package/src/shared/chromium/decryptor.ts +27 -6
  237. package/src/shared/utils/concurrency.test.ts +6 -6
  238. package/src/shared/utils/derived-key-cache.test.ts +11 -11
  239. package/src/tui/utils.test.ts +31 -31
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  const originalConsoleLog = console.log
4
4
 
@@ -49,7 +49,7 @@ describe('chat commands', () => {
49
49
  })
50
50
 
51
51
  describe('list', () => {
52
- test('lists chat rooms', async () => {
52
+ it('lists chat rooms', async () => {
53
53
  await chatCommand.parseAsync(['list'], { from: 'user' })
54
54
 
55
55
  expect(mockGetChats).toHaveBeenCalled()
@@ -59,21 +59,21 @@ describe('chat commands', () => {
59
59
  expect(output[0].name).toBe('General')
60
60
  })
61
61
 
62
- test('passes --search option to getChats', async () => {
62
+ it('passes --search option to getChats', async () => {
63
63
  await chatCommand.parseAsync(['list', '--search', 'General'], { from: 'user' })
64
64
 
65
65
  const call = mockGetChats.mock.calls[0][0] as { all?: boolean; search?: string }
66
66
  expect(call.search).toBe('General')
67
67
  })
68
68
 
69
- test('passes --all flag to getChats', async () => {
69
+ it('passes --all flag to getChats', async () => {
70
70
  await chatCommand.parseAsync(['list', '--all'], { from: 'user' })
71
71
 
72
72
  const call = mockGetChats.mock.calls[0][0] as { all?: boolean; search?: string }
73
73
  expect(call.all).toBe(true)
74
74
  })
75
75
 
76
- test('passes account option to withKakaoClient', async () => {
76
+ it('passes account option to withKakaoClient', async () => {
77
77
  await chatCommand.parseAsync(['list', '--account', 'my-account'], { from: 'user' })
78
78
 
79
79
  expect(mockWithKakaoClient).toHaveBeenCalledWith(
@@ -82,7 +82,7 @@ describe('chat commands', () => {
82
82
  )
83
83
  })
84
84
 
85
- test('outputs empty array when no chats', async () => {
85
+ it('outputs empty array when no chats', async () => {
86
86
  mockGetChats.mockImplementation(() => Promise.resolve([]))
87
87
 
88
88
  await chatCommand.parseAsync(['list'], { from: 'user' })
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  const originalConsoleLog = console.log
4
4
 
@@ -48,7 +48,7 @@ describe('message commands', () => {
48
48
  })
49
49
 
50
50
  describe('list', () => {
51
- test('fetches messages for a chat room with default count', async () => {
51
+ it('fetches messages for a chat room with default count', async () => {
52
52
  await messageCommand.parseAsync(['list', 'chat-123', '--count', '20'], { from: 'user' })
53
53
 
54
54
  expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 20, from: undefined })
@@ -58,19 +58,19 @@ describe('message commands', () => {
58
58
  expect(output[0].message).toBe('Hello')
59
59
  })
60
60
 
61
- test('respects --count option', async () => {
61
+ it('respects --count option', async () => {
62
62
  await messageCommand.parseAsync(['list', 'chat-123', '--count', '5'], { from: 'user' })
63
63
 
64
64
  expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 5, from: undefined })
65
65
  })
66
66
 
67
- test('respects --from option', async () => {
67
+ it('respects --from option', async () => {
68
68
  await messageCommand.parseAsync(['list', 'chat-123', '--count', '20', '--from', '999'], { from: 'user' })
69
69
 
70
70
  expect(mockGetMessages).toHaveBeenCalledWith('chat-123', { count: 20, from: '999' })
71
71
  })
72
72
 
73
- test('passes account option to withKakaoClient', async () => {
73
+ it('passes account option to withKakaoClient', async () => {
74
74
  await messageCommand.parseAsync(['list', 'chat-123', '--count', '20', '--account', 'my-account'], {
75
75
  from: 'user',
76
76
  })
@@ -83,7 +83,7 @@ describe('message commands', () => {
83
83
  })
84
84
 
85
85
  describe('send', () => {
86
- test('sends a message to a chat room', async () => {
86
+ it('sends a message to a chat room', async () => {
87
87
  await messageCommand.parseAsync(['send', 'chat-123', 'Hello world'], { from: 'user' })
88
88
 
89
89
  expect(mockSendMessage).toHaveBeenCalledWith('chat-123', 'Hello world')
@@ -92,7 +92,7 @@ describe('message commands', () => {
92
92
  expect(output.message).toBe('Hi there')
93
93
  })
94
94
 
95
- test('passes account option to withKakaoClient', async () => {
95
+ it('passes account option to withKakaoClient', async () => {
96
96
  await messageCommand.parseAsync(['send', 'chat-123', 'Hi', '--account', 'my-account'], { from: 'user' })
97
97
 
98
98
  expect(mockWithKakaoClient).toHaveBeenCalledWith(
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  const originalConsoleLog = console.log
4
4
 
@@ -68,7 +68,7 @@ describe('whoami command', () => {
68
68
  console.log = originalConsoleLog
69
69
  })
70
70
 
71
- test('outputs profile information', async () => {
71
+ it('outputs profile information', async () => {
72
72
  await whoamiCommand.parseAsync([], { from: 'user' })
73
73
 
74
74
  expect(mockGetProfile).toHaveBeenCalled()
@@ -78,7 +78,7 @@ describe('whoami command', () => {
78
78
  expect(output.profile_image_url).toBe('https://example.com/avatar.jpg')
79
79
  })
80
80
 
81
- test('outputs enriched profile fields', async () => {
81
+ it('outputs enriched profile fields', async () => {
82
82
  await whoamiCommand.parseAsync([], { from: 'user' })
83
83
 
84
84
  const output = JSON.parse(consoleLogSpy.mock.calls[0][0])
@@ -92,7 +92,7 @@ describe('whoami command', () => {
92
92
  expect(output.email_verified).toBe(true)
93
93
  })
94
94
 
95
- test('passes account option to withKakaoClient', async () => {
95
+ it('passes account option to withKakaoClient', async () => {
96
96
  await whoamiCommand.parseAsync(['--account', 'my-account'], { from: 'user' })
97
97
 
98
98
  expect(mockWithKakaoClient).toHaveBeenCalledWith(
@@ -101,7 +101,7 @@ describe('whoami command', () => {
101
101
  )
102
102
  })
103
103
 
104
- test('outputs profile with pretty flag', async () => {
104
+ it('outputs profile with pretty flag', async () => {
105
105
  await whoamiCommand.parseAsync(['--pretty'], { from: 'user' })
106
106
 
107
107
  expect(mockGetProfile).toHaveBeenCalled()
@@ -1,4 +1,4 @@
1
- import { afterAll, describe, expect, test } from 'bun:test'
1
+ import { afterAll, describe, expect, it } from 'bun:test'
2
2
  import { rmSync } from 'node:fs'
3
3
  import { join } from 'node:path'
4
4
 
@@ -35,7 +35,7 @@ afterAll(() => {
35
35
 
36
36
  describe('KakaoCredentialManager', () => {
37
37
  describe('load', () => {
38
- test('returns default config when file does not exist', async () => {
38
+ it('returns default config when file does not exist', async () => {
39
39
  const manager = setup()
40
40
  const config = await manager.load()
41
41
 
@@ -44,7 +44,7 @@ describe('KakaoCredentialManager', () => {
44
44
  })
45
45
 
46
46
  describe('save/load round-trip', () => {
47
- test('creates file and can be re-read via load', async () => {
47
+ it('creates file and can be re-read via load', async () => {
48
48
  const manager = setup()
49
49
  const account = makeAccount()
50
50
  const config = {
@@ -62,21 +62,21 @@ describe('KakaoCredentialManager', () => {
62
62
  })
63
63
 
64
64
  describe('getAccount', () => {
65
- test('returns null when no accounts exist', async () => {
65
+ it('returns null when no accounts exist', async () => {
66
66
  const manager = setup()
67
67
  const account = await manager.getAccount()
68
68
 
69
69
  expect(account).toBeNull()
70
70
  })
71
71
 
72
- test('returns null for nonexistent account ID', async () => {
72
+ it('returns null for nonexistent account ID', async () => {
73
73
  const manager = setup()
74
74
  const account = await manager.getAccount('nonexistent')
75
75
 
76
76
  expect(account).toBeNull()
77
77
  })
78
78
 
79
- test('returns account by explicit ID', async () => {
79
+ it('returns account by explicit ID', async () => {
80
80
  const manager = setup()
81
81
  const account = makeAccount()
82
82
 
@@ -86,7 +86,7 @@ describe('KakaoCredentialManager', () => {
86
86
  expect(retrieved).toEqual(account)
87
87
  })
88
88
 
89
- test('returns current account when no ID given', async () => {
89
+ it('returns current account when no ID given', async () => {
90
90
  const manager = setup()
91
91
  const account = makeAccount()
92
92
 
@@ -98,7 +98,7 @@ describe('KakaoCredentialManager', () => {
98
98
  })
99
99
 
100
100
  describe('setAccount', () => {
101
- test('stores account and auto-sets current_account if null', async () => {
101
+ it('stores account and auto-sets current_account if null', async () => {
102
102
  const manager = setup()
103
103
  const account = makeAccount()
104
104
 
@@ -109,7 +109,7 @@ describe('KakaoCredentialManager', () => {
109
109
  expect(config.accounts['test-account']).toEqual(account)
110
110
  })
111
111
 
112
- test('does NOT override existing current_account', async () => {
112
+ it('does NOT override existing current_account', async () => {
113
113
  const manager = setup()
114
114
  const first = makeAccount({ account_id: 'first-account' })
115
115
  const second = makeAccount({ account_id: 'second-account' })
@@ -123,14 +123,14 @@ describe('KakaoCredentialManager', () => {
123
123
  })
124
124
 
125
125
  describe('listAccounts', () => {
126
- test('returns empty array for empty config', async () => {
126
+ it('returns empty array for empty config', async () => {
127
127
  const manager = setup()
128
128
  const accounts = await manager.listAccounts()
129
129
 
130
130
  expect(accounts).toEqual([])
131
131
  })
132
132
 
133
- test('returns all accounts with correct is_current flag', async () => {
133
+ it('returns all accounts with correct is_current flag', async () => {
134
134
  const manager = setup()
135
135
  const first = makeAccount({ account_id: 'first-account' })
136
136
  const second = makeAccount({ account_id: 'second-account' })
@@ -149,7 +149,7 @@ describe('KakaoCredentialManager', () => {
149
149
  })
150
150
 
151
151
  describe('setCurrentAccount', () => {
152
- test('switches active account', async () => {
152
+ it('switches active account', async () => {
153
153
  const manager = setup()
154
154
  const first = makeAccount({ account_id: 'first-account' })
155
155
  const second = makeAccount({ account_id: 'second-account' })
@@ -164,7 +164,7 @@ describe('KakaoCredentialManager', () => {
164
164
  })
165
165
 
166
166
  describe('removeAccount', () => {
167
- test('removes and rotates current to next available', async () => {
167
+ it('removes and rotates current to next available', async () => {
168
168
  const manager = setup()
169
169
  const first = makeAccount({ account_id: 'first-account' })
170
170
  const second = makeAccount({ account_id: 'second-account' })
@@ -181,7 +181,7 @@ describe('KakaoCredentialManager', () => {
181
181
  expect(current?.account_id).toBe('second-account')
182
182
  })
183
183
 
184
- test('handles removing non-current account', async () => {
184
+ it('handles removing non-current account', async () => {
185
185
  const manager = setup()
186
186
  const first = makeAccount({ account_id: 'first-account' })
187
187
  const second = makeAccount({ account_id: 'second-account' })
@@ -201,7 +201,7 @@ describe('KakaoCredentialManager', () => {
201
201
  })
202
202
 
203
203
  describe('savePendingLogin/loadPendingLogin/clearPendingLogin', () => {
204
- test('full lifecycle: save, load, clear', async () => {
204
+ it('handles full save, load, and clear lifecycle', async () => {
205
205
  const manager = setup()
206
206
  const state = {
207
207
  device_uuid: 'uuid-abc',
@@ -1,4 +1,4 @@
1
- import { expect, test } from 'bun:test'
1
+ import { expect, it } from 'bun:test'
2
2
 
3
3
  import {
4
4
  CredentialManager,
@@ -17,58 +17,58 @@ import {
17
17
  KakaoTalkPushReadEventSchema,
18
18
  } from '@/platforms/kakaotalk/index'
19
19
 
20
- test('KakaoTalkClient is exported from barrel', () => {
20
+ it('KakaoTalkClient is exported from barrel', () => {
21
21
  expect(typeof KakaoTalkClient).toBe('function')
22
22
  })
23
23
 
24
- test('KakaoTalkError is exported from barrel', () => {
24
+ it('KakaoTalkError is exported from barrel', () => {
25
25
  expect(typeof KakaoTalkError).toBe('function')
26
26
  })
27
27
 
28
- test('CredentialManager is exported from barrel', () => {
28
+ it('CredentialManager is exported from barrel', () => {
29
29
  expect(typeof CredentialManager).toBe('function')
30
30
  })
31
31
 
32
- test('KakaoCredentialManager is exported from barrel', () => {
32
+ it('KakaoCredentialManager is exported from barrel', () => {
33
33
  expect(typeof KakaoCredentialManager).toBe('function')
34
34
  })
35
35
 
36
- test('KakaoTalkListener is exported from barrel', () => {
36
+ it('KakaoTalkListener is exported from barrel', () => {
37
37
  expect(typeof KakaoTalkListener).toBe('function')
38
38
  })
39
39
 
40
- test('KakaoChatSchema is exported from barrel', () => {
40
+ it('KakaoChatSchema is exported from barrel', () => {
41
41
  expect(typeof KakaoChatSchema.parse).toBe('function')
42
42
  })
43
43
 
44
- test('KakaoMessageSchema is exported from barrel', () => {
44
+ it('KakaoMessageSchema is exported from barrel', () => {
45
45
  expect(typeof KakaoMessageSchema.parse).toBe('function')
46
46
  })
47
47
 
48
- test('KakaoSendResultSchema is exported from barrel', () => {
48
+ it('KakaoSendResultSchema is exported from barrel', () => {
49
49
  expect(typeof KakaoSendResultSchema.parse).toBe('function')
50
50
  })
51
51
 
52
- test('KakaoAccountCredentialsSchema is exported from barrel', () => {
52
+ it('KakaoAccountCredentialsSchema is exported from barrel', () => {
53
53
  expect(typeof KakaoAccountCredentialsSchema.parse).toBe('function')
54
54
  })
55
55
 
56
- test('KakaoConfigSchema is exported from barrel', () => {
56
+ it('KakaoConfigSchema is exported from barrel', () => {
57
57
  expect(typeof KakaoConfigSchema.parse).toBe('function')
58
58
  })
59
59
 
60
- test('KakaoTalkPushMessageEventSchema is exported from barrel', () => {
60
+ it('KakaoTalkPushMessageEventSchema is exported from barrel', () => {
61
61
  expect(typeof KakaoTalkPushMessageEventSchema.parse).toBe('function')
62
62
  })
63
63
 
64
- test('KakaoTalkPushMemberEventSchema is exported from barrel', () => {
64
+ it('KakaoTalkPushMemberEventSchema is exported from barrel', () => {
65
65
  expect(typeof KakaoTalkPushMemberEventSchema.parse).toBe('function')
66
66
  })
67
67
 
68
- test('KakaoTalkPushReadEventSchema is exported from barrel', () => {
68
+ it('KakaoTalkPushReadEventSchema is exported from barrel', () => {
69
69
  expect(typeof KakaoTalkPushReadEventSchema.parse).toBe('function')
70
70
  })
71
71
 
72
- test('KakaoProfileSchema is exported from barrel', () => {
72
+ it('KakaoProfileSchema is exported from barrel', () => {
73
73
  expect(typeof KakaoProfileSchema.parse).toBe('function')
74
74
  })
@@ -1,4 +1,4 @@
1
- import { afterEach, describe, expect, mock, test } from 'bun:test'
1
+ import { afterEach, describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  import { KakaoTalkListener } from '@/platforms/kakaotalk/listener'
4
4
  import type { LocoPacket } from '@/platforms/kakaotalk/protocol/types'
@@ -67,7 +67,7 @@ describe('KakaoTalkListener', () => {
67
67
  })
68
68
 
69
69
  describe('start', () => {
70
- test('calls login on LocoSession', async () => {
70
+ it('calls login on LocoSession', async () => {
71
71
  const client = createMockClient()
72
72
  listener = new KakaoTalkListener(client)
73
73
 
@@ -77,7 +77,7 @@ describe('KakaoTalkListener', () => {
77
77
  expect(mockLogin).toHaveBeenCalledWith('token', 'user1', 'device1', undefined, 'tablet')
78
78
  })
79
79
 
80
- test('is idempotent', async () => {
80
+ it('is idempotent', async () => {
81
81
  const client = createMockClient()
82
82
  listener = new KakaoTalkListener(client)
83
83
 
@@ -89,7 +89,7 @@ describe('KakaoTalkListener', () => {
89
89
  })
90
90
 
91
91
  describe('connected event', () => {
92
- test('emits connected with userId after successful login', async () => {
92
+ it('emits connected with userId after successful login', async () => {
93
93
  const client = createMockClient()
94
94
  listener = new KakaoTalkListener(client)
95
95
 
@@ -104,7 +104,7 @@ describe('KakaoTalkListener', () => {
104
104
  })
105
105
 
106
106
  describe('message events', () => {
107
- test('emits message on MSG push with parsed fields', async () => {
107
+ it('emits message on MSG push with parsed fields', async () => {
108
108
  const client = createMockClient()
109
109
  listener = new KakaoTalkListener(client)
110
110
 
@@ -135,7 +135,7 @@ describe('KakaoTalkListener', () => {
135
135
  })
136
136
 
137
137
  describe('member events', () => {
138
- test('emits member_joined on NEWMEM push', async () => {
138
+ it('emits member_joined on NEWMEM push', async () => {
139
139
  const client = createMockClient()
140
140
  listener = new KakaoTalkListener(client)
141
141
 
@@ -154,7 +154,7 @@ describe('KakaoTalkListener', () => {
154
154
  expect(joined[0].member.user_id).toBe(42)
155
155
  })
156
156
 
157
- test('emits member_left on DELMEM push', async () => {
157
+ it('emits member_left on DELMEM push', async () => {
158
158
  const client = createMockClient()
159
159
  listener = new KakaoTalkListener(client)
160
160
 
@@ -175,7 +175,7 @@ describe('KakaoTalkListener', () => {
175
175
  })
176
176
 
177
177
  describe('read events', () => {
178
- test('emits read on DECUNREAD push with watermark', async () => {
178
+ it('emits read on DECUNREAD push with watermark', async () => {
179
179
  const client = createMockClient()
180
180
  listener = new KakaoTalkListener(client)
181
181
 
@@ -198,7 +198,7 @@ describe('KakaoTalkListener', () => {
198
198
  })
199
199
 
200
200
  describe('kakaotalk_event catch-all', () => {
201
- test('emits kakaotalk_event for every push event', async () => {
201
+ it('emits kakaotalk_event for every push event', async () => {
202
202
  const client = createMockClient()
203
203
  listener = new KakaoTalkListener(client)
204
204
 
@@ -224,7 +224,7 @@ describe('KakaoTalkListener', () => {
224
224
  })
225
225
 
226
226
  describe('stop', () => {
227
- test('closes session and prevents reconnection', async () => {
227
+ it('closes session and prevents reconnection', async () => {
228
228
  const client = createMockClient()
229
229
  listener = new KakaoTalkListener(client)
230
230
 
@@ -239,7 +239,7 @@ describe('KakaoTalkListener', () => {
239
239
  })
240
240
 
241
241
  describe('reconnection', () => {
242
- test('reconnects on session close when still running', async () => {
242
+ it('reconnects on session close when still running', async () => {
243
243
  const client = createMockClient()
244
244
  listener = new KakaoTalkListener(client)
245
245
 
@@ -255,7 +255,7 @@ describe('KakaoTalkListener', () => {
255
255
  expect(mockLogin.mock.calls.length).toBeGreaterThanOrEqual(2)
256
256
  })
257
257
 
258
- test('emits error and reconnects on login failure', async () => {
258
+ it('emits error and reconnects on login failure', async () => {
259
259
  let callCount = 0
260
260
  mockLogin.mockImplementation(() => {
261
261
  callCount++
@@ -280,7 +280,7 @@ describe('KakaoTalkListener', () => {
280
280
  })
281
281
 
282
282
  describe('CHANGESVR', () => {
283
- test('resets reconnect attempts to 0 on CHANGESVR push', async () => {
283
+ it('resets reconnect attempts to 0 on CHANGESVR push', async () => {
284
284
  const client = createMockClient()
285
285
  listener = new KakaoTalkListener(client)
286
286
 
@@ -294,7 +294,7 @@ describe('KakaoTalkListener', () => {
294
294
  })
295
295
 
296
296
  describe('KICKOUT', () => {
297
- test('emits error and stops without reconnecting', async () => {
297
+ it('emits error and stops without reconnecting', async () => {
298
298
  const client = createMockClient()
299
299
  listener = new KakaoTalkListener(client)
300
300
 
@@ -314,7 +314,7 @@ describe('KakaoTalkListener', () => {
314
314
  })
315
315
 
316
316
  describe('on/off/once', () => {
317
- test('off removes listener', async () => {
317
+ it('off removes listener', async () => {
318
318
  const client = createMockClient()
319
319
  listener = new KakaoTalkListener(client)
320
320
 
@@ -338,7 +338,7 @@ describe('KakaoTalkListener', () => {
338
338
  expect(messages[0].message).toBe('first')
339
339
  })
340
340
 
341
- test('once fires only once', async () => {
341
+ it('once fires only once', async () => {
342
342
  const client = createMockClient()
343
343
  listener = new KakaoTalkListener(client)
344
344
 
@@ -361,7 +361,7 @@ describe('KakaoTalkListener', () => {
361
361
  })
362
362
 
363
363
  describe('start after stop', () => {
364
- test('resets reconnect attempts on fresh start', async () => {
364
+ it('resets reconnect attempts on fresh start', async () => {
365
365
  const client = createMockClient()
366
366
  listener = new KakaoTalkListener(client)
367
367
 
@@ -1,43 +1,43 @@
1
- import { describe, expect, test } from 'bun:test'
1
+ import { describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { LineClient } from './client'
4
4
  import { LineError } from './types'
5
5
  import type { LineChat, LineDevice, LineLoginResult, LineMessage, LineSendResult } from './types'
6
6
 
7
7
  describe('LineClient', () => {
8
- test('constructor creates instance without errors', () => {
8
+ it('constructor creates instance without errors', () => {
9
9
  const client = new LineClient()
10
10
  expect(client).toBeInstanceOf(LineClient)
11
11
  })
12
12
 
13
- test('constructor accepts a custom credential manager', () => {
13
+ it('constructor accepts a custom credential manager', () => {
14
14
  const { LineCredentialManager } = require('./credential-manager')
15
15
  const manager = new LineCredentialManager()
16
16
  const client = new LineClient(manager)
17
17
  expect(client).toBeInstanceOf(LineClient)
18
18
  })
19
19
 
20
- test('close() is idempotent - can be called multiple times without error', () => {
20
+ it('close() is idempotent - can be called multiple times without error', () => {
21
21
  const client = new LineClient()
22
22
  expect(() => client.close()).not.toThrow()
23
23
  expect(() => client.close()).not.toThrow()
24
24
  expect(() => client.close()).not.toThrow()
25
25
  })
26
26
 
27
- test('close() is idempotent after login attempt fails', async () => {
27
+ it('close() is idempotent after login attempt fails', async () => {
28
28
  const client = new LineClient()
29
29
  client.close()
30
30
  client.close()
31
31
  })
32
32
 
33
33
  describe('ensureClient throws when not logged in', () => {
34
- test('getChats() throws LineError with code not_connected', async () => {
34
+ it('getChats() throws LineError with code not_connected', async () => {
35
35
  const client = new LineClient()
36
36
  await expect(client.getChats()).rejects.toThrow(LineError)
37
37
  await expect(client.getChats()).rejects.toMatchObject({ code: 'not_connected' })
38
38
  })
39
39
 
40
- test('getMessages() throws LineError when not logged in', async () => {
40
+ it('getMessages() throws LineError when not logged in', async () => {
41
41
  const client = new LineClient()
42
42
  await expect(client.getMessages('chat123')).rejects.toThrow(LineError)
43
43
  await expect(client.getMessages('chat123')).rejects.toMatchObject({
@@ -45,7 +45,7 @@ describe('LineClient', () => {
45
45
  })
46
46
  })
47
47
 
48
- test('sendMessage() throws LineError when not logged in', async () => {
48
+ it('sendMessage() throws LineError when not logged in', async () => {
49
49
  const client = new LineClient()
50
50
  await expect(client.sendMessage('chat123', 'hello')).rejects.toThrow(LineError)
51
51
  await expect(client.sendMessage('chat123', 'hello')).rejects.toMatchObject({
@@ -55,7 +55,7 @@ describe('LineClient', () => {
55
55
  })
56
56
 
57
57
  describe('login() without credentials', () => {
58
- test('throws LineError when no saved credentials exist', async () => {
58
+ it('throws LineError when no saved credentials exist', async () => {
59
59
  const { LineCredentialManager } = require('./credential-manager')
60
60
  const { mkdtemp } = require('node:fs/promises')
61
61
  const { tmpdir } = require('node:os')
@@ -71,7 +71,7 @@ describe('LineClient', () => {
71
71
  })
72
72
 
73
73
  describe('LineError', () => {
74
- test('LineError has correct name, code, and message', () => {
74
+ it('LineError has correct name, code, and message', () => {
75
75
  const err = new LineError('test_code', 'test message')
76
76
  expect(err).toBeInstanceOf(Error)
77
77
  expect(err).toBeInstanceOf(LineError)
@@ -80,7 +80,7 @@ describe('LineClient', () => {
80
80
  expect(err.message).toBe('test message')
81
81
  })
82
82
 
83
- test('LineError is thrown by getChats and wraps the not_connected error', async () => {
83
+ it('LineError is thrown by getChats and wraps the not_connected error', async () => {
84
84
  const client = new LineClient()
85
85
  try {
86
86
  await client.getChats()
@@ -95,13 +95,13 @@ describe('LineClient', () => {
95
95
  })
96
96
 
97
97
  describe('default device detection', () => {
98
- test('LineClient can be instantiated (device detection does not throw)', () => {
98
+ it('LineClient can be instantiated (device detection does not throw)', () => {
99
99
  expect(() => new LineClient()).not.toThrow()
100
100
  })
101
101
  })
102
102
 
103
103
  describe('type exports', () => {
104
- test('LineChat type is correctly shaped', () => {
104
+ it('LineChat type is correctly shaped', () => {
105
105
  const chat: LineChat = {
106
106
  chat_id: 'c1234567890abcdef1234567890abcdef',
107
107
  type: 'group',
@@ -114,7 +114,7 @@ describe('LineClient', () => {
114
114
  expect(chat.member_count).toBe(5)
115
115
  })
116
116
 
117
- test('LineMessage type is correctly shaped', () => {
117
+ it('LineMessage type is correctly shaped', () => {
118
118
  const msg: LineMessage = {
119
119
  message_id: 'msg123',
120
120
  chat_id: 'chat456',
@@ -127,7 +127,7 @@ describe('LineClient', () => {
127
127
  expect(msg.text).toBe('Hello')
128
128
  })
129
129
 
130
- test('LineMessage text can be null', () => {
130
+ it('LineMessage text can be null', () => {
131
131
  const msg: LineMessage = {
132
132
  message_id: 'msg123',
133
133
  chat_id: 'chat456',
@@ -139,7 +139,7 @@ describe('LineClient', () => {
139
139
  expect(msg.text).toBeNull()
140
140
  })
141
141
 
142
- test('LineSendResult type is correctly shaped', () => {
142
+ it('LineSendResult type is correctly shaped', () => {
143
143
  const result: LineSendResult = {
144
144
  success: true,
145
145
  chat_id: 'chat456',
@@ -149,7 +149,7 @@ describe('LineClient', () => {
149
149
  expect(result.success).toBe(true)
150
150
  })
151
151
 
152
- test('LineLoginResult type is correctly shaped', () => {
152
+ it('LineLoginResult type is correctly shaped', () => {
153
153
  const result: LineLoginResult = {
154
154
  authenticated: true,
155
155
  account_id: 'u1234567890abcdef1234567890abcdef',