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 { expect, test } from 'bun:test'
1
+ import { expect, it } from 'bun:test'
2
2
 
3
3
  import {
4
4
  ChannelBotBotSchema,
@@ -17,58 +17,58 @@ import {
17
17
  MessageBlockSchema,
18
18
  } from '@/platforms/channeltalkbot/index'
19
19
 
20
- test('ChannelBotClient is exported from barrel', () => {
20
+ it('ChannelBotClient is exported from barrel', () => {
21
21
  expect(typeof ChannelBotClient).toBe('function')
22
22
  })
23
23
 
24
- test('ChannelBotError is exported from barrel', () => {
24
+ it('ChannelBotError is exported from barrel', () => {
25
25
  expect(typeof ChannelBotError).toBe('function')
26
26
  })
27
27
 
28
- test('ChannelBotCredentialManager is exported from barrel', () => {
28
+ it('ChannelBotCredentialManager is exported from barrel', () => {
29
29
  expect(typeof ChannelBotCredentialManager).toBe('function')
30
30
  })
31
31
 
32
- test('ChannelBotBotSchema is exported from barrel', () => {
32
+ it('ChannelBotBotSchema is exported from barrel', () => {
33
33
  expect(typeof ChannelBotBotSchema.parse).toBe('function')
34
34
  })
35
35
 
36
- test('ChannelBotChannelSchema is exported from barrel', () => {
36
+ it('ChannelBotChannelSchema is exported from barrel', () => {
37
37
  expect(typeof ChannelBotChannelSchema.parse).toBe('function')
38
38
  })
39
39
 
40
- test('ChannelBotConfigSchema is exported from barrel', () => {
40
+ it('ChannelBotConfigSchema is exported from barrel', () => {
41
41
  expect(typeof ChannelBotConfigSchema.parse).toBe('function')
42
42
  })
43
43
 
44
- test('ChannelBotCredentialsSchema is exported from barrel', () => {
44
+ it('ChannelBotCredentialsSchema is exported from barrel', () => {
45
45
  expect(typeof ChannelBotCredentialsSchema.parse).toBe('function')
46
46
  })
47
47
 
48
- test('ChannelBotGroupSchema is exported from barrel', () => {
48
+ it('ChannelBotGroupSchema is exported from barrel', () => {
49
49
  expect(typeof ChannelBotGroupSchema.parse).toBe('function')
50
50
  })
51
51
 
52
- test('ChannelBotManagerSchema is exported from barrel', () => {
52
+ it('ChannelBotManagerSchema is exported from barrel', () => {
53
53
  expect(typeof ChannelBotManagerSchema.parse).toBe('function')
54
54
  })
55
55
 
56
- test('ChannelBotMessageSchema is exported from barrel', () => {
56
+ it('ChannelBotMessageSchema is exported from barrel', () => {
57
57
  expect(typeof ChannelBotMessageSchema.parse).toBe('function')
58
58
  })
59
59
 
60
- test('ChannelBotUserChatSchema is exported from barrel', () => {
60
+ it('ChannelBotUserChatSchema is exported from barrel', () => {
61
61
  expect(typeof ChannelBotUserChatSchema.parse).toBe('function')
62
62
  })
63
63
 
64
- test('ChannelBotUserSchema is exported from barrel', () => {
64
+ it('ChannelBotUserSchema is exported from barrel', () => {
65
65
  expect(typeof ChannelBotUserSchema.parse).toBe('function')
66
66
  })
67
67
 
68
- test('ChannelBotWorkspaceEntrySchema is exported from barrel', () => {
68
+ it('ChannelBotWorkspaceEntrySchema is exported from barrel', () => {
69
69
  expect(typeof ChannelBotWorkspaceEntrySchema.parse).toBe('function')
70
70
  })
71
71
 
72
- test('MessageBlockSchema is exported from barrel', () => {
72
+ it('MessageBlockSchema is exported from barrel', () => {
73
73
  expect(typeof MessageBlockSchema.parse).toBe('function')
74
74
  })
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient, DiscordError } from './client'
4
4
 
@@ -48,19 +48,19 @@ describe('DiscordClient', () => {
48
48
  }
49
49
 
50
50
  describe('constructor', () => {
51
- test('requires token', async () => {
51
+ it('requires token', async () => {
52
52
  await expect(new DiscordClient().login({ token: '' })).rejects.toThrow(DiscordError)
53
53
  await expect(new DiscordClient().login({ token: '' })).rejects.toThrow('Token is required')
54
54
  })
55
55
 
56
- test('accepts valid token', async () => {
56
+ it('accepts valid token', async () => {
57
57
  const client = await new DiscordClient().login({ token: 'test-token' })
58
58
  expect(client).toBeInstanceOf(DiscordClient)
59
59
  })
60
60
  })
61
61
 
62
62
  describe('testAuth', () => {
63
- test('returns current user info', async () => {
63
+ it('returns current user info', async () => {
64
64
  mockResponse({
65
65
  id: '123456789',
66
66
  username: 'testuser',
@@ -80,7 +80,7 @@ describe('DiscordClient', () => {
80
80
  })
81
81
  })
82
82
 
83
- test('throws DiscordError on API error', async () => {
83
+ it('throws DiscordError on API error', async () => {
84
84
  mockResponse({ message: 'Unauthorized', code: 401 }, 401)
85
85
 
86
86
  const client = await new DiscordClient().login({ token: 'bad-token' })
@@ -89,7 +89,7 @@ describe('DiscordClient', () => {
89
89
  })
90
90
 
91
91
  describe('listServers', () => {
92
- test('returns list of servers', async () => {
92
+ it('returns list of servers', async () => {
93
93
  mockResponse([
94
94
  { id: '111', name: 'Server One' },
95
95
  { id: '222', name: 'Server Two' },
@@ -105,7 +105,7 @@ describe('DiscordClient', () => {
105
105
  })
106
106
 
107
107
  describe('getServer', () => {
108
- test('returns server info', async () => {
108
+ it('returns server info', async () => {
109
109
  mockResponse({ id: '111', name: 'Test Server' })
110
110
 
111
111
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -118,7 +118,7 @@ describe('DiscordClient', () => {
118
118
  })
119
119
 
120
120
  describe('listChannels', () => {
121
- test('returns list of channels for server', async () => {
121
+ it('returns list of channels for server', async () => {
122
122
  mockResponse([
123
123
  { id: 'ch1', guild_id: '111', name: 'general', type: 0 },
124
124
  { id: 'ch2', guild_id: '111', name: 'random', type: 0 },
@@ -134,7 +134,7 @@ describe('DiscordClient', () => {
134
134
  })
135
135
 
136
136
  describe('getChannel', () => {
137
- test('returns channel info', async () => {
137
+ it('returns channel info', async () => {
138
138
  mockResponse({ id: 'ch1', guild_id: '111', name: 'general', type: 0 })
139
139
 
140
140
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -147,7 +147,7 @@ describe('DiscordClient', () => {
147
147
  })
148
148
 
149
149
  describe('sendMessage', () => {
150
- test('sends message to channel', async () => {
150
+ it('sends message to channel', async () => {
151
151
  mockResponse({
152
152
  id: 'msg1',
153
153
  channel_id: 'ch1',
@@ -167,7 +167,7 @@ describe('DiscordClient', () => {
167
167
  })
168
168
 
169
169
  describe('getMessages', () => {
170
- test('returns messages from channel', async () => {
170
+ it('returns messages from channel', async () => {
171
171
  mockResponse([
172
172
  {
173
173
  id: 'msg1',
@@ -186,7 +186,7 @@ describe('DiscordClient', () => {
186
186
  expect(fetchCalls[0].url).toBe('https://discord.com/api/v10/channels/ch1/messages?limit=50')
187
187
  })
188
188
 
189
- test('uses default limit of 50', async () => {
189
+ it('uses default limit of 50', async () => {
190
190
  mockResponse([])
191
191
 
192
192
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -197,7 +197,7 @@ describe('DiscordClient', () => {
197
197
  })
198
198
 
199
199
  describe('getMessage', () => {
200
- test('returns single message', async () => {
200
+ it('returns single message', async () => {
201
201
  mockResponse({
202
202
  id: 'msg1',
203
203
  channel_id: 'ch1',
@@ -215,7 +215,7 @@ describe('DiscordClient', () => {
215
215
  })
216
216
 
217
217
  describe('deleteMessage', () => {
218
- test('deletes message', async () => {
218
+ it('deletes message', async () => {
219
219
  mockResponse(null, 204)
220
220
 
221
221
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -227,7 +227,7 @@ describe('DiscordClient', () => {
227
227
  })
228
228
 
229
229
  describe('addReaction', () => {
230
- test('adds reaction to message', async () => {
230
+ it('adds reaction to message', async () => {
231
231
  mockResponse(null, 204)
232
232
 
233
233
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -241,7 +241,7 @@ describe('DiscordClient', () => {
241
241
  })
242
242
 
243
243
  describe('removeReaction', () => {
244
- test('removes reaction from message', async () => {
244
+ it('removes reaction from message', async () => {
245
245
  mockResponse(null, 204)
246
246
 
247
247
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -255,7 +255,7 @@ describe('DiscordClient', () => {
255
255
  })
256
256
 
257
257
  describe('listUsers', () => {
258
- test('returns list of server members', async () => {
258
+ it('returns list of server members', async () => {
259
259
  mockResponse([{ user: { id: 'u1', username: 'user1' } }, { user: { id: 'u2', username: 'user2' } }])
260
260
 
261
261
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -268,7 +268,7 @@ describe('DiscordClient', () => {
268
268
  })
269
269
 
270
270
  describe('getUser', () => {
271
- test('returns user info', async () => {
271
+ it('returns user info', async () => {
272
272
  mockResponse({ id: 'u1', username: 'testuser' })
273
273
 
274
274
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -281,7 +281,7 @@ describe('DiscordClient', () => {
281
281
  })
282
282
 
283
283
  describe('uploadFile', () => {
284
- test('uploads file to channel', async () => {
284
+ it('uploads file to channel', async () => {
285
285
  const tempFile = '/tmp/test-upload.txt'
286
286
  await Bun.write(tempFile, 'test content')
287
287
 
@@ -311,7 +311,7 @@ describe('DiscordClient', () => {
311
311
  })
312
312
 
313
313
  describe('listFiles', () => {
314
- test('returns files from recent messages', async () => {
314
+ it('returns files from recent messages', async () => {
315
315
  mockResponse([
316
316
  {
317
317
  id: 'msg1',
@@ -340,7 +340,7 @@ describe('DiscordClient', () => {
340
340
  })
341
341
 
342
342
  describe('rate limiting', () => {
343
- test('waits when bucket is exhausted before making request', async () => {
343
+ it('waits when bucket is exhausted before making request', async () => {
344
344
  mockResponse({ id: '1', username: 'user1' }, 200, {
345
345
  'X-RateLimit-Remaining': '0',
346
346
  'X-RateLimit-Reset': String(Date.now() / 1000 + 0.1),
@@ -363,7 +363,7 @@ describe('DiscordClient', () => {
363
363
  expect(fetchCalls.length).toBe(2)
364
364
  })
365
365
 
366
- test('retries on 429 with Retry-After header', async () => {
366
+ it('retries on 429 with Retry-After header', async () => {
367
367
  mockResponse({ message: 'Rate limited', retry_after: 0.1 }, 429, { 'Retry-After': '0.1' })
368
368
  mockResponse({ id: '123', username: 'user' })
369
369
 
@@ -374,7 +374,7 @@ describe('DiscordClient', () => {
374
374
  expect(fetchCalls.length).toBe(2)
375
375
  })
376
376
 
377
- test('handles global rate limit', async () => {
377
+ it('handles global rate limit', async () => {
378
378
  mockResponse({ message: 'Global rate limited', global: true }, 429, {
379
379
  'Retry-After': '0.1',
380
380
  'X-RateLimit-Global': 'true',
@@ -388,7 +388,7 @@ describe('DiscordClient', () => {
388
388
  expect(fetchCalls.length).toBe(2)
389
389
  })
390
390
 
391
- test('throws after max retries exceeded', async () => {
391
+ it('throws after max retries exceeded', async () => {
392
392
  for (let i = 0; i <= 3; i++) {
393
393
  mockResponse({ message: 'Rate limited' }, 429, { 'Retry-After': '0.01' })
394
394
  }
@@ -400,7 +400,7 @@ describe('DiscordClient', () => {
400
400
  })
401
401
 
402
402
  describe('retry logic', () => {
403
- test('retries on 500 server error', async () => {
403
+ it('retries on 500 server error', async () => {
404
404
  mockResponse({ message: 'Internal Server Error' }, 500)
405
405
  mockResponse({ id: '123', username: 'user' })
406
406
 
@@ -411,7 +411,7 @@ describe('DiscordClient', () => {
411
411
  expect(fetchCalls.length).toBe(2)
412
412
  })
413
413
 
414
- test('does not retry on 4xx client errors (except 429)', async () => {
414
+ it('does not retry on 4xx client errors (except 429)', async () => {
415
415
  mockResponse({ message: 'Not Found' }, 404)
416
416
 
417
417
  const client = await new DiscordClient().login({ token: 'test-token' })
@@ -419,7 +419,7 @@ describe('DiscordClient', () => {
419
419
  expect(fetchCalls.length).toBe(1)
420
420
  })
421
421
 
422
- test('exponential backoff increases delay', async () => {
422
+ it('exponential backoff increases delay', async () => {
423
423
  mockResponse({ message: 'Error' }, 500)
424
424
  mockResponse({ message: 'Error' }, 500)
425
425
  mockResponse({ id: '123', username: 'user' })
@@ -435,7 +435,7 @@ describe('DiscordClient', () => {
435
435
  })
436
436
 
437
437
  describe('bucket key normalization', () => {
438
- test('normalizes channel IDs in routes', async () => {
438
+ it('normalizes channel IDs in routes', async () => {
439
439
  mockResponse([])
440
440
  mockResponse([])
441
441
 
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -52,40 +52,40 @@ afterEach(() => {
52
52
  credManagerClearTokenSpy?.mockRestore()
53
53
  })
54
54
 
55
- test('extract: calls DiscordTokenExtractor', async () => {
55
+ it('extract: calls DiscordTokenExtractor', async () => {
56
56
  const extractor = new DiscordTokenExtractor()
57
57
  const result = await extractor.extract()
58
58
  expect(result).toBeDefined()
59
59
  expect(result[0]?.token).toBe('test-token-123')
60
60
  })
61
61
 
62
- test('extract: validates token with DiscordClient', async () => {
62
+ it('extract: validates token with DiscordClient', async () => {
63
63
  const client = await new DiscordClient().login({ token: 'test-token-123' })
64
64
  const authInfo = await client.testAuth()
65
65
  expect(authInfo).toBeDefined()
66
66
  expect(authInfo.id).toBe('user-123')
67
67
  })
68
68
 
69
- test('extract: discovers servers', async () => {
69
+ it('extract: discovers servers', async () => {
70
70
  const client = await new DiscordClient().login({ token: 'test-token-123' })
71
71
  const servers = await client.listServers()
72
72
  expect(servers).toHaveLength(2)
73
73
  expect(servers[0].id).toBe('server-1')
74
74
  })
75
75
 
76
- test('logout: clears credentials', async () => {
76
+ it('logout: clears credentials', async () => {
77
77
  const credManager = new DiscordCredentialManager()
78
78
  await credManager.clearToken()
79
79
  expect(credManager.clearToken).toHaveBeenCalled()
80
80
  })
81
81
 
82
- test('status: returns auth state', async () => {
82
+ it('status: returns auth state', async () => {
83
83
  const credManager = new DiscordCredentialManager()
84
84
  const config = await credManager.load()
85
85
  expect(config.token).toBeNull()
86
86
  expect(config.current_server).toBeNull()
87
87
  })
88
88
 
89
- test('no-token message mentions desktop app and browser fallback', () => {
89
+ it('no-token message mentions desktop app and browser fallback', () => {
90
90
  expect(getNoDiscordTokenFoundMessage()).toContain('desktop app or a supported Chromium browser')
91
91
  })
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -72,7 +72,7 @@ afterEach(() => {
72
72
  credManagerLoadSpy?.mockRestore()
73
73
  })
74
74
 
75
- test('list: returns text channels (type=0) from server', async () => {
75
+ it('list: returns text channels (type=0) from server', async () => {
76
76
  // given: discord client with channels
77
77
  const client = await new DiscordClient().login({ token: 'test-token' })
78
78
  const channels = await client.listChannels('server-1')
@@ -86,7 +86,7 @@ test('list: returns text channels (type=0) from server', async () => {
86
86
  expect(textChannels[1].name).toBe('announcements')
87
87
  })
88
88
 
89
- test('list: includes channel metadata', async () => {
89
+ it('list: includes channel metadata', async () => {
90
90
  // given: discord client with channels
91
91
  const client = await new DiscordClient().login({ token: 'test-token' })
92
92
  const channels = await client.listChannels('server-1')
@@ -102,7 +102,7 @@ test('list: includes channel metadata', async () => {
102
102
  expect(channel.topic).toBeDefined()
103
103
  })
104
104
 
105
- test('info: returns channel details', async () => {
105
+ it('info: returns channel details', async () => {
106
106
  // given: discord client with channel data
107
107
  const client = await new DiscordClient().login({ token: 'test-token' })
108
108
  const channel = await client.getChannel('ch-1')
@@ -117,7 +117,7 @@ test('info: returns channel details', async () => {
117
117
  expect(channel.topic).toBe('General discussion')
118
118
  })
119
119
 
120
- test('info: throws error for non-existent channel', async () => {
120
+ it('info: throws error for non-existent channel', async () => {
121
121
  // given: discord client
122
122
  const client = await new DiscordClient().login({ token: 'test-token' })
123
123
 
@@ -131,7 +131,7 @@ test('info: throws error for non-existent channel', async () => {
131
131
  }
132
132
  })
133
133
 
134
- test('history: returns messages in reverse chronological order', async () => {
134
+ it('history: returns messages in reverse chronological order', async () => {
135
135
  // given: discord client with messages
136
136
  const client = await new DiscordClient().login({ token: 'test-token' })
137
137
  const messages = await client.getMessages('ch-1', 50)
@@ -147,7 +147,7 @@ test('history: returns messages in reverse chronological order', async () => {
147
147
  expect(messages[1].author.username).toBe('bob')
148
148
  })
149
149
 
150
- test('history: includes message metadata', async () => {
150
+ it('history: includes message metadata', async () => {
151
151
  // given: discord client with messages
152
152
  const client = await new DiscordClient().login({ token: 'test-token' })
153
153
  const messages = await client.getMessages('ch-1', 50)
@@ -66,7 +66,7 @@ afterEach(() => {
66
66
 
67
67
  describe('dm commands', () => {
68
68
  describe('listAction', () => {
69
- it('should list DM channels', async () => {
69
+ it('lists DM channels', async () => {
70
70
  const consoleSpy = mock(() => {})
71
71
  const originalLog = console.log
72
72
  console.log = consoleSpy
@@ -79,7 +79,7 @@ describe('dm commands', () => {
79
79
  expect(clientListDMChannelsSpy).toHaveBeenCalled()
80
80
  })
81
81
 
82
- it('should handle authentication error', async () => {
82
+ it('handles authentication error', async () => {
83
83
  credManagerLoadSpy.mockResolvedValue({
84
84
  token: '',
85
85
  current_server: null,
@@ -105,7 +105,7 @@ describe('dm commands', () => {
105
105
  })
106
106
 
107
107
  describe('createAction', () => {
108
- it('should create a DM channel', async () => {
108
+ it('creates a DM channel', async () => {
109
109
  const consoleSpy = mock(() => {})
110
110
  const originalLog = console.log
111
111
  console.log = consoleSpy
@@ -118,7 +118,7 @@ describe('dm commands', () => {
118
118
  expect(clientCreateDMSpy).toHaveBeenCalledWith('456')
119
119
  })
120
120
 
121
- it('should handle authentication error', async () => {
121
+ it('handles authentication error', async () => {
122
122
  credManagerLoadSpy.mockResolvedValue({
123
123
  token: '',
124
124
  current_server: null,
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, mock, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, mock, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -49,7 +49,7 @@ afterEach(() => {
49
49
  credManagerLoadSpy?.mockRestore()
50
50
  })
51
51
 
52
- test('upload: sends multipart request and returns file info', async () => {
52
+ it('upload: sends multipart request and returns file info', async () => {
53
53
  const consoleSpy = mock((_msg: string) => {})
54
54
  console.log = consoleSpy
55
55
 
@@ -61,7 +61,7 @@ test('upload: sends multipart request and returns file info', async () => {
61
61
  expect(output).toContain('test.pdf')
62
62
  })
63
63
 
64
- test('list: filters messages with attachments', async () => {
64
+ it('list: filters messages with attachments', async () => {
65
65
  const consoleSpy = mock((_msg: string) => {})
66
66
  console.log = consoleSpy
67
67
 
@@ -73,7 +73,7 @@ test('list: filters messages with attachments', async () => {
73
73
  expect(output).toContain('file_124')
74
74
  })
75
75
 
76
- test('info: returns single file details', async () => {
76
+ it('info: returns single file details', async () => {
77
77
  const consoleSpy = mock((_msg: string) => {})
78
78
  console.log = consoleSpy
79
79
 
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -62,7 +62,7 @@ afterEach(() => {
62
62
  credManagerLoadSpy?.mockRestore()
63
63
  })
64
64
 
65
- test('list: returns all relationships', async () => {
65
+ it('list: returns all relationships', async () => {
66
66
  // given: discord client with relationships
67
67
  const client = await new DiscordClient().login({ token: 'test-token' })
68
68
  const relationships = await client.getRelationships()
@@ -74,7 +74,7 @@ test('list: returns all relationships', async () => {
74
74
  expect(relationships).toHaveLength(4)
75
75
  })
76
76
 
77
- test('list: includes relationship metadata', async () => {
77
+ it('list: includes relationship metadata', async () => {
78
78
  // given: discord client with relationships
79
79
  const client = await new DiscordClient().login({ token: 'test-token' })
80
80
  const relationships = await client.getRelationships()
@@ -90,7 +90,7 @@ test('list: includes relationship metadata', async () => {
90
90
  expect(relationship.user.username).toBeDefined()
91
91
  })
92
92
 
93
- test('list: filters friends (type=1)', async () => {
93
+ it('list: filters friends (type=1)', async () => {
94
94
  // given: discord client with relationships
95
95
  const client = await new DiscordClient().login({ token: 'test-token' })
96
96
  const relationships = await client.getRelationships()
@@ -104,7 +104,7 @@ test('list: filters friends (type=1)', async () => {
104
104
  expect(friends[1].user.username).toBe('bob')
105
105
  })
106
106
 
107
- test('list: includes optional nickname', async () => {
107
+ it('list: includes optional nickname', async () => {
108
108
  // given: discord client with relationships
109
109
  const client = await new DiscordClient().login({ token: 'test-token' })
110
110
  const relationships = await client.getRelationships()
@@ -118,7 +118,7 @@ test('list: includes optional nickname', async () => {
118
118
  expect(withoutNickname?.nickname).toBeUndefined()
119
119
  })
120
120
 
121
- test('list: distinguishes relationship types', async () => {
121
+ it('list: distinguishes relationship types', async () => {
122
122
  // given: discord client with relationships
123
123
  const client = await new DiscordClient().login({ token: 'test-token' })
124
124
  const relationships = await client.getRelationships()
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -54,7 +54,7 @@ afterEach(() => {
54
54
  credManagerLoadSpy?.mockRestore()
55
55
  })
56
56
 
57
- test('search: returns members matching query', async () => {
57
+ it('search: returns members matching query', async () => {
58
58
  const client = await new DiscordClient().login({ token: 'test-token' })
59
59
  const members = await client.searchMembers('guild-1', 'alice', 10)
60
60
 
@@ -64,7 +64,7 @@ test('search: returns members matching query', async () => {
64
64
  expect(members[1].user.username).toBe('alice_bot')
65
65
  })
66
66
 
67
- test('search: includes member metadata', async () => {
67
+ it('search: includes member metadata', async () => {
68
68
  const client = await new DiscordClient().login({ token: 'test-token' })
69
69
  const members = await client.searchMembers('guild-1', 'alice', 10)
70
70
 
@@ -82,7 +82,7 @@ test('search: includes member metadata', async () => {
82
82
  expect(member.flags).toBe(0)
83
83
  })
84
84
 
85
- test('search: respects limit parameter', async () => {
85
+ it('search: respects limit parameter', async () => {
86
86
  const client = await new DiscordClient().login({ token: 'test-token' })
87
87
 
88
88
  await client.searchMembers('guild-1', 'alice', 5)
@@ -90,7 +90,7 @@ test('search: respects limit parameter', async () => {
90
90
  expect(clientSearchMembersSpy).toHaveBeenCalledWith('guild-1', 'alice', 5)
91
91
  })
92
92
 
93
- test('search: uses default limit of 10', async () => {
93
+ it('search: uses default limit of 10', async () => {
94
94
  const client = await new DiscordClient().login({ token: 'test-token' })
95
95
 
96
96
  const members = await client.searchMembers('guild-1', 'alice')
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { DiscordClient } from '../client'
4
4
  import { DiscordCredentialManager } from '../credential-manager'
@@ -46,7 +46,7 @@ afterEach(() => {
46
46
  credManagerLoadSpy?.mockRestore()
47
47
  })
48
48
 
49
- test('getMentions: returns mentions', async () => {
49
+ it('getMentions: returns mentions', async () => {
50
50
  // given: discord client
51
51
  const client = await new DiscordClient().login({ token: 'test-token' })
52
52
 
@@ -62,7 +62,7 @@ test('getMentions: returns mentions', async () => {
62
62
  expect(mentions[1].mention_everyone).toBe(true)
63
63
  })
64
64
 
65
- test('getMentions: respects limit option', async () => {
65
+ it('getMentions: respects limit option', async () => {
66
66
  // given: discord client with limit option
67
67
  const client = await new DiscordClient().login({ token: 'test-token' })
68
68
  clientGetMentionsSpy.mockResolvedValue([
@@ -85,7 +85,7 @@ test('getMentions: respects limit option', async () => {
85
85
  expect(clientGetMentionsSpy).toHaveBeenCalledWith({ limit: 1 })
86
86
  })
87
87
 
88
- test('getMentions: respects guildId option', async () => {
88
+ it('getMentions: respects guildId option', async () => {
89
89
  // given: discord client with guildId option
90
90
  const client = await new DiscordClient().login({ token: 'test-token' })
91
91
  clientGetMentionsSpy.mockResolvedValue([
@@ -110,7 +110,7 @@ test('getMentions: respects guildId option', async () => {
110
110
  expect(clientGetMentionsSpy).toHaveBeenCalledWith({ guildId: 'guild-1' })
111
111
  })
112
112
 
113
- test('getMentions: includes mention metadata', async () => {
113
+ it('getMentions: includes mention metadata', async () => {
114
114
  // given: discord client with mentions
115
115
  const client = await new DiscordClient().login({ token: 'test-token' })
116
116
  const mentions = await client.getMentions()