agent-messenger 2.10.1 → 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 +9 -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 +109 -49
  180. package/src/platforms/teams/token-extractor.ts +7 -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, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { SlackClient } from '@/platforms/slack/client'
4
4
  import { snapshotCommand } from '@/platforms/slack/commands/snapshot'
@@ -6,35 +6,35 @@ import { CredentialManager } from '@/platforms/slack/credential-manager'
6
6
  import type { SlackChannel, SlackMessage, SlackUser } from '@/platforms/slack/types'
7
7
 
8
8
  // Test the command structure (no mocks needed)
9
- test('snapshot command exports correctly', () => {
9
+ it('snapshot command exports correctly', () => {
10
10
  expect(snapshotCommand).toBeDefined()
11
11
  expect(typeof snapshotCommand).toBe('object')
12
12
  })
13
13
 
14
- test('snapshot command has correct structure', () => {
14
+ it('snapshot command has correct structure', () => {
15
15
  expect(snapshotCommand.name()).toBe('snapshot')
16
16
  expect(snapshotCommand.description()).toContain('workspace')
17
17
  })
18
18
 
19
- test('snapshot command has --channels-only option', () => {
19
+ it('snapshot command has --channels-only option', () => {
20
20
  const options = snapshotCommand.options
21
21
  const hasChannelsOnly = options.some((opt: any) => opt.long === '--channels-only')
22
22
  expect(hasChannelsOnly).toBe(true)
23
23
  })
24
24
 
25
- test('snapshot command has --users-only option', () => {
25
+ it('snapshot command has --users-only option', () => {
26
26
  const options = snapshotCommand.options
27
27
  const hasUsersOnly = options.some((opt: any) => opt.long === '--users-only')
28
28
  expect(hasUsersOnly).toBe(true)
29
29
  })
30
30
 
31
- test('snapshot command has --limit option', () => {
31
+ it('snapshot command has --limit option', () => {
32
32
  const options = snapshotCommand.options
33
33
  const hasLimit = options.some((opt: any) => opt.long === '--limit')
34
34
  expect(hasLimit).toBe(true)
35
35
  })
36
36
 
37
- test('snapshot command has --full option', () => {
37
+ it('snapshot command has --full option', () => {
38
38
  const options = snapshotCommand.options
39
39
  const hasFull = options.some((opt: any) => opt.long === '--full')
40
40
  expect(hasFull).toBe(true)
@@ -153,7 +153,7 @@ afterEach(() => {
153
153
  clientGetMessagesSpy?.mockRestore()
154
154
  })
155
155
 
156
- test('brief snapshot (default) returns workspace, channels as {id, name}, and hint', async () => {
156
+ it('brief snapshot (default) returns workspace, channels as {id, name}, and hint', async () => {
157
157
  const client = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
158
158
 
159
159
  const auth = await client.testAuth()
@@ -185,7 +185,7 @@ test('brief snapshot (default) returns workspace, channels as {id, name}, and hi
185
185
  expect(snapshot.hint).toContain('message list')
186
186
  })
187
187
 
188
- test('brief snapshot excludes archived channels', async () => {
188
+ it('brief snapshot excludes archived channels', async () => {
189
189
  const channelsWithArchived: SlackChannel[] = [
190
190
  ...mockChannels,
191
191
  {
@@ -210,7 +210,7 @@ test('brief snapshot excludes archived channels', async () => {
210
210
  expect(active.every((ch) => !ch.is_archived)).toBe(true)
211
211
  })
212
212
 
213
- test('full snapshot returns workspace, channels, messages, and users', async () => {
213
+ it('full snapshot returns workspace, channels, messages, and users', async () => {
214
214
  const client = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
215
215
 
216
216
  const auth = await client.testAuth()
@@ -278,7 +278,7 @@ test('full snapshot returns workspace, channels, messages, and users', async ()
278
278
  expect(snapshot.users[0].name).toBe('alice')
279
279
  })
280
280
 
281
- test('snapshot with --channels-only excludes messages and users', async () => {
281
+ it('snapshot with --channels-only excludes messages and users', async () => {
282
282
  const client = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
283
283
 
284
284
  const auth = await client.testAuth()
@@ -307,7 +307,7 @@ test('snapshot with --channels-only excludes messages and users', async () => {
307
307
  expect((snapshot as any).users).toBeUndefined()
308
308
  })
309
309
 
310
- test('snapshot with --users-only excludes channels and messages', async () => {
310
+ it('snapshot with --users-only excludes channels and messages', async () => {
311
311
  const client = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
312
312
 
313
313
  const auth = await client.testAuth()
@@ -335,7 +335,7 @@ test('snapshot with --users-only excludes channels and messages', async () => {
335
335
  expect((snapshot as any).recent_messages).toBeUndefined()
336
336
  })
337
337
 
338
- test('snapshot respects --limit option for messages', async () => {
338
+ it('snapshot respects --limit option for messages', async () => {
339
339
  const client = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
340
340
 
341
341
  const auth = await client.testAuth()
@@ -43,7 +43,7 @@ afterEach(() => {
43
43
 
44
44
  describe('unread commands', () => {
45
45
  describe('getUnreadCounts', () => {
46
- it('should return unread counts', async () => {
46
+ it('returns unread counts', async () => {
47
47
  const mockCounts = {
48
48
  channels: [
49
49
  { id: 'C123', name: 'general', unread_count: 5, mention_count: 2 },
@@ -66,7 +66,7 @@ describe('unread commands', () => {
66
66
  })
67
67
 
68
68
  describe('getThreadView', () => {
69
- it('should return thread subscription details', async () => {
69
+ it('returns thread subscription details', async () => {
70
70
  const mockThreadView = {
71
71
  channel_id: 'C123',
72
72
  thread_ts: '1234567890.123456',
@@ -87,7 +87,7 @@ describe('unread commands', () => {
87
87
  })
88
88
 
89
89
  describe('markRead', () => {
90
- it('should mark channel as read', async () => {
90
+ it('marks channel as read', async () => {
91
91
  const mockClient = await new SlackClient().login({ token: 'xoxc-test', cookie: 'test-cookie' })
92
92
  await mockClient.markRead('C123', '1234567890.123456')
93
93
 
@@ -96,7 +96,7 @@ describe('unread commands', () => {
96
96
  })
97
97
 
98
98
  describe('CLI commands', () => {
99
- it('should handle unread counts command', async () => {
99
+ it('handles unread counts command', async () => {
100
100
  const mockConsoleLog = mock(() => {})
101
101
  const originalLog = console.log
102
102
  console.log = mockConsoleLog
@@ -109,7 +109,7 @@ describe('unread commands', () => {
109
109
  console.log = originalLog
110
110
  })
111
111
 
112
- it('should handle unread threads command', async () => {
112
+ it('handles unread threads command', async () => {
113
113
  const mockConsoleLog = mock(() => {})
114
114
  const originalLog = console.log
115
115
  console.log = mockConsoleLog
@@ -122,7 +122,7 @@ describe('unread commands', () => {
122
122
  console.log = originalLog
123
123
  })
124
124
 
125
- it('should handle mark read command', async () => {
125
+ it('handles mark read command', async () => {
126
126
  const mockConsoleLog = mock(() => {})
127
127
  const originalLog = console.log
128
128
  console.log = mockConsoleLog
@@ -1,4 +1,4 @@
1
- import { describe, expect, test } from 'bun:test'
1
+ import { describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { SlackClient } from '@/platforms/slack/client'
4
4
  import { userCommand } from '@/platforms/slack/commands/user'
@@ -44,7 +44,7 @@ const mockUsers: SlackUser[] = [
44
44
 
45
45
  describe('User Commands', () => {
46
46
  describe('user list', () => {
47
- test('lists all users', async () => {
47
+ it('lists all users', async () => {
48
48
  // Given: SlackClient with users
49
49
  const _mockClient = {
50
50
  listUsers: async () => mockUsers,
@@ -57,14 +57,14 @@ describe('User Commands', () => {
57
57
  expect(result).toBeDefined()
58
58
  })
59
59
 
60
- test('filters out bots by default', async () => {
60
+ it('filters out bots by default', async () => {
61
61
  // Given: Users including bots
62
62
  // When: Listing without --include-bots flag
63
63
  // Then: Should exclude bots (is_bot: true)
64
64
  expect(mockUsers.filter((u) => !u.is_bot)).toHaveLength(2)
65
65
  })
66
66
 
67
- test('includes bots with --include-bots flag', async () => {
67
+ it('includes bots with --include-bots flag', async () => {
68
68
  // Given: Users including bots
69
69
  // When: Listing with --include-bots flag
70
70
  // Then: Should include all users
@@ -73,7 +73,7 @@ describe('User Commands', () => {
73
73
  })
74
74
 
75
75
  describe('user info', () => {
76
- test('shows user details by ID', async () => {
76
+ it('shows user details by ID', async () => {
77
77
  // Given: User ID
78
78
  // When: Getting user info
79
79
  // Then: Should return user details
@@ -82,7 +82,7 @@ describe('User Commands', () => {
82
82
  expect(user.name).toBe('alice')
83
83
  })
84
84
 
85
- test('returns error for invalid user ID', async () => {
85
+ it('returns error for invalid user ID', async () => {
86
86
  // Given: Invalid user ID
87
87
  // When: Getting user info
88
88
  // Then: Should return error
@@ -91,14 +91,14 @@ describe('User Commands', () => {
91
91
  })
92
92
 
93
93
  describe('user me', () => {
94
- test('shows current authenticated user', async () => {
94
+ it('shows current authenticated user', async () => {
95
95
  // Given: Authenticated client
96
96
  // When: Running user me
97
97
  // Then: Should return current user info
98
98
  expect(true).toBe(true)
99
99
  })
100
100
 
101
- test('includes user profile details', async () => {
101
+ it('includes user profile details', async () => {
102
102
  // Given: Current user
103
103
  const user = mockUsers[0]
104
104
 
@@ -110,7 +110,7 @@ describe('User Commands', () => {
110
110
  })
111
111
 
112
112
  describe('output format', () => {
113
- test('returns JSON with user data', async () => {
113
+ it('returns JSON with user data', async () => {
114
114
  // Given: Users
115
115
  const user = mockUsers[0]
116
116
 
@@ -122,7 +122,7 @@ describe('User Commands', () => {
122
122
  expect(json).toContain('alice')
123
123
  })
124
124
 
125
- test('supports --pretty flag for formatting', async () => {
125
+ it('supports --pretty flag for formatting', async () => {
126
126
  // Given: Output data
127
127
  const data = { users: mockUsers }
128
128
 
@@ -1,4 +1,4 @@
1
- import { beforeEach, describe, expect, mock, test } from 'bun:test'
1
+ import { beforeEach, describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  import { SlackClient } from '@/platforms/slack/client'
4
4
  import type { SlackUsergroup } from '@/platforms/slack/types'
@@ -39,14 +39,14 @@ describe('Usergroup Commands', () => {
39
39
  })
40
40
 
41
41
  describe('usergroup list', () => {
42
- test('lists all user groups', async () => {
42
+ it('lists all user groups', async () => {
43
43
  const usergroups = await (mockClient as SlackClient).listUsergroups()
44
44
  expect(usergroups).toHaveLength(1)
45
45
  expect(usergroups[0].name).toBe('Marketing Team')
46
46
  expect(usergroups[0].handle).toBe('marketing-team')
47
47
  })
48
48
 
49
- test('throws error when API fails', async () => {
49
+ it('throws error when API fails', async () => {
50
50
  mockClient.listUsergroups = mock(async () => {
51
51
  throw new Error('invalid_auth')
52
52
  })
@@ -55,7 +55,7 @@ describe('Usergroup Commands', () => {
55
55
  })
56
56
 
57
57
  describe('usergroup create', () => {
58
- test('creates a user group successfully', async () => {
58
+ it('creates a user group successfully', async () => {
59
59
  const result = await (mockClient as SlackClient).createUsergroup('Marketing Team', {
60
60
  handle: 'marketing-team',
61
61
  description: 'Marketing gurus, PR experts and product advocates.',
@@ -64,7 +64,7 @@ describe('Usergroup Commands', () => {
64
64
  expect(result.name).toBe('Marketing Team')
65
65
  })
66
66
 
67
- test('throws error when API fails', async () => {
67
+ it('throws error when API fails', async () => {
68
68
  mockClient.createUsergroup = mock(async () => {
69
69
  throw new Error('name_already_exists')
70
70
  })
@@ -73,7 +73,7 @@ describe('Usergroup Commands', () => {
73
73
  })
74
74
 
75
75
  describe('usergroup update', () => {
76
- test('updates a user group successfully', async () => {
76
+ it('updates a user group successfully', async () => {
77
77
  const result = await (mockClient as SlackClient).updateUsergroup('S0616NG6M', {
78
78
  name: 'Marketing Team',
79
79
  handle: 'marketing-team',
@@ -82,7 +82,7 @@ describe('Usergroup Commands', () => {
82
82
  expect(result.name).toBe('Marketing Team')
83
83
  })
84
84
 
85
- test('throws error when API fails', async () => {
85
+ it('throws error when API fails', async () => {
86
86
  mockClient.updateUsergroup = mock(async () => {
87
87
  throw new Error('no_such_subteam')
88
88
  })
@@ -93,13 +93,13 @@ describe('Usergroup Commands', () => {
93
93
  })
94
94
 
95
95
  describe('usergroup enable', () => {
96
- test('enables a user group successfully', async () => {
96
+ it('enables a user group successfully', async () => {
97
97
  const result = await (mockClient as SlackClient).enableUsergroup('S0616NG6M')
98
98
  expect(result.id).toBe('S0616NG6M')
99
99
  expect(result.date_delete).toBe(0)
100
100
  })
101
101
 
102
- test('throws error when API fails', async () => {
102
+ it('throws error when API fails', async () => {
103
103
  mockClient.enableUsergroup = mock(async () => {
104
104
  throw new Error('no_such_subteam')
105
105
  })
@@ -108,13 +108,13 @@ describe('Usergroup Commands', () => {
108
108
  })
109
109
 
110
110
  describe('usergroup disable', () => {
111
- test('disables a user group successfully', async () => {
111
+ it('disables a user group successfully', async () => {
112
112
  const result = await (mockClient as SlackClient).disableUsergroup('S0616NG6M')
113
113
  expect(result.id).toBe('S0616NG6M')
114
114
  expect(result.date_delete).toBeGreaterThan(0)
115
115
  })
116
116
 
117
- test('throws error when API fails', async () => {
117
+ it('throws error when API fails', async () => {
118
118
  mockClient.disableUsergroup = mock(async () => {
119
119
  throw new Error('no_such_subteam')
120
120
  })
@@ -123,14 +123,14 @@ describe('Usergroup Commands', () => {
123
123
  })
124
124
 
125
125
  describe('usergroup members', () => {
126
- test('lists members of a user group', async () => {
126
+ it('lists members of a user group', async () => {
127
127
  const users = await (mockClient as SlackClient).listUsergroupMembers('S0616NG6M')
128
128
  expect(users).toHaveLength(2)
129
129
  expect(users).toContain('U060R4BJ4')
130
130
  expect(users).toContain('U060RNRCZ')
131
131
  })
132
132
 
133
- test('throws error when API fails', async () => {
133
+ it('throws error when API fails', async () => {
134
134
  mockClient.listUsergroupMembers = mock(async () => {
135
135
  throw new Error('no_such_subteam')
136
136
  })
@@ -139,13 +139,13 @@ describe('Usergroup Commands', () => {
139
139
  })
140
140
 
141
141
  describe('usergroup members-update', () => {
142
- test('updates members of a user group', async () => {
142
+ it('updates members of a user group', async () => {
143
143
  const result = await (mockClient as SlackClient).updateUsergroupMembers('S0616NG6M', ['U060R4BJ4', 'U060RNRCZ'])
144
144
  expect(result.id).toBe('S0616NG6M')
145
145
  expect(result.users).toHaveLength(2)
146
146
  })
147
147
 
148
- test('throws error when no users provided', async () => {
148
+ it('throws error when no users provided', async () => {
149
149
  mockClient.updateUsergroupMembers = mock(async () => {
150
150
  throw new Error('no_users_provided')
151
151
  })
@@ -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 { SlackClient } from '@/platforms/slack/client'
4
4
  import { whoamiAction, whoamiCommand } from '@/platforms/slack/commands/whoami'
@@ -54,19 +54,19 @@ afterEach(() => {
54
54
  processExitSpy?.mockRestore()
55
55
  })
56
56
 
57
- test('whoami command is defined with correct name and description', () => {
57
+ it('whoami command is defined with correct name and description', () => {
58
58
  expect(whoamiCommand).toBeDefined()
59
59
  expect(whoamiCommand.name()).toBe('whoami')
60
60
  expect(whoamiCommand.description()).toBe('Show current authenticated user')
61
61
  })
62
62
 
63
- test('whoami command has --pretty option', () => {
63
+ it('whoami command has --pretty option', () => {
64
64
  const options = whoamiCommand.options
65
65
  const hasPretty = options.some((opt: { long?: string }) => opt.long === '--pretty')
66
66
  expect(hasPretty).toBe(true)
67
67
  })
68
68
 
69
- test('whoami outputs expected fields', async () => {
69
+ it('whoami outputs expected fields', async () => {
70
70
  await whoamiAction({})
71
71
 
72
72
  expect(consoleLogSpy).toHaveBeenCalledWith(
@@ -88,7 +88,7 @@ test('whoami outputs expected fields', async () => {
88
88
  )
89
89
  })
90
90
 
91
- test('whoami outputs pretty-printed JSON when pretty is true', async () => {
91
+ it('whoami outputs pretty-printed JSON when pretty is true', async () => {
92
92
  await whoamiAction({ pretty: true })
93
93
 
94
94
  expect(consoleLogSpy).toHaveBeenCalledWith(
@@ -114,7 +114,7 @@ test('whoami outputs pretty-printed JSON when pretty is true', async () => {
114
114
  )
115
115
  })
116
116
 
117
- test('whoami exits with error when no workspace is set', async () => {
117
+ it('whoami exits with error when no workspace is set', async () => {
118
118
  credManagerSpy.mockResolvedValue(null)
119
119
 
120
120
  await whoamiAction({})
@@ -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
 
@@ -24,13 +24,13 @@ afterAll(() => {
24
24
 
25
25
  describe('Workspace Commands', () => {
26
26
  describe('workspace list', () => {
27
- test('returns empty list when no workspaces exist', async () => {
27
+ it('returns empty list when no workspaces exist', async () => {
28
28
  const credManager = setup()
29
29
  const config = await credManager.load()
30
30
  expect(Object.keys(config.workspaces)).toHaveLength(0)
31
31
  })
32
32
 
33
- test('lists all workspaces with current marker', async () => {
33
+ it('lists all workspaces with current marker', async () => {
34
34
  const credManager = setup()
35
35
  const ws1: WorkspaceCredentials = {
36
36
  workspace_id: 'T123',
@@ -58,7 +58,7 @@ describe('Workspace Commands', () => {
58
58
  expect(config.current_workspace).toBe('T123')
59
59
  })
60
60
 
61
- test('shows current marker for active workspace', async () => {
61
+ it('shows current marker for active workspace', async () => {
62
62
  const credManager = setup()
63
63
  const ws: WorkspaceCredentials = {
64
64
  workspace_id: 'T789',
@@ -75,7 +75,7 @@ describe('Workspace Commands', () => {
75
75
  expect(config.workspaces.T789).toBeDefined()
76
76
  })
77
77
 
78
- test('handles list with no current workspace', async () => {
78
+ it('handles list with no current workspace', async () => {
79
79
  const credManager = setup()
80
80
  const ws: WorkspaceCredentials = {
81
81
  workspace_id: 'T999',
@@ -93,7 +93,7 @@ describe('Workspace Commands', () => {
93
93
  })
94
94
 
95
95
  describe('workspace switch', () => {
96
- test('switches to existing workspace', async () => {
96
+ it('switches to existing workspace', async () => {
97
97
  const credManager = setup()
98
98
  const ws1: WorkspaceCredentials = {
99
99
  workspace_id: 'T111',
@@ -117,13 +117,13 @@ describe('Workspace Commands', () => {
117
117
  expect(config.current_workspace).toBe('T222')
118
118
  })
119
119
 
120
- test('fails when workspace does not exist', async () => {
120
+ it('fails when workspace does not exist', async () => {
121
121
  const credManager = setup()
122
122
  const ws = await credManager.getWorkspace('nonexistent')
123
123
  expect(ws).toBeNull()
124
124
  })
125
125
 
126
- test('validates workspace exists before switching', async () => {
126
+ it('validates workspace exists before switching', async () => {
127
127
  const credManager = setup()
128
128
  const ws: WorkspaceCredentials = {
129
129
  workspace_id: 'T333',
@@ -140,7 +140,7 @@ describe('Workspace Commands', () => {
140
140
  expect(targetExists).toBe(false)
141
141
  })
142
142
 
143
- test('preserves workspace credentials when switching', async () => {
143
+ it('preserves workspace credentials when switching', async () => {
144
144
  const credManager = setup()
145
145
  const ws1: WorkspaceCredentials = {
146
146
  workspace_id: 'T444',
@@ -171,7 +171,7 @@ describe('Workspace Commands', () => {
171
171
  })
172
172
 
173
173
  describe('workspace current', () => {
174
- test('returns current workspace details', async () => {
174
+ it('returns current workspace details', async () => {
175
175
  const credManager = setup()
176
176
  const ws: WorkspaceCredentials = {
177
177
  workspace_id: 'T666',
@@ -191,13 +191,13 @@ describe('Workspace Commands', () => {
191
191
  expect(current?.cookie).toBe('xoxd-666')
192
192
  })
193
193
 
194
- test('returns null when no current workspace set', async () => {
194
+ it('returns null when no current workspace set', async () => {
195
195
  const credManager = setup()
196
196
  const current = await credManager.getWorkspace()
197
197
  expect(current).toBeNull()
198
198
  })
199
199
 
200
- test('returns null when current workspace is deleted', async () => {
200
+ it('returns null when current workspace is deleted', async () => {
201
201
  const credManager = setup()
202
202
  const ws: WorkspaceCredentials = {
203
203
  workspace_id: 'T777',
@@ -214,7 +214,7 @@ describe('Workspace Commands', () => {
214
214
  expect(current).toBeNull()
215
215
  })
216
216
 
217
- test('shows correct workspace after switching', async () => {
217
+ it('shows correct workspace after switching', async () => {
218
218
  const credManager = setup()
219
219
  const ws1: WorkspaceCredentials = {
220
220
  workspace_id: 'T888',
@@ -241,7 +241,7 @@ describe('Workspace Commands', () => {
241
241
  })
242
242
 
243
243
  describe('workspace remove', () => {
244
- test('removes workspace by id', async () => {
244
+ it('removes workspace by id', async () => {
245
245
  const credManager = setup()
246
246
  const ws: WorkspaceCredentials = {
247
247
  workspace_id: 'T-remove',
@@ -257,7 +257,7 @@ describe('Workspace Commands', () => {
257
257
  expect(retrieved).toBeNull()
258
258
  })
259
259
 
260
- test('removes current workspace and clears current', async () => {
260
+ it('removes current workspace and clears current', async () => {
261
261
  const credManager = setup()
262
262
  const ws: WorkspaceCredentials = {
263
263
  workspace_id: 'T-current-remove',
@@ -274,7 +274,7 @@ describe('Workspace Commands', () => {
274
274
  expect(config.current_workspace).toBeNull()
275
275
  })
276
276
 
277
- test('removes workspace without affecting others', async () => {
277
+ it('removes workspace without affecting others', async () => {
278
278
  const credManager = setup()
279
279
  const ws1: WorkspaceCredentials = {
280
280
  workspace_id: 'T-keep',
@@ -300,7 +300,7 @@ describe('Workspace Commands', () => {
300
300
  expect(config.current_workspace).toBe('T-keep')
301
301
  })
302
302
 
303
- test('handles removing non-existent workspace gracefully', async () => {
303
+ it('handles removing non-existent workspace gracefully', async () => {
304
304
  const credManager = setup()
305
305
  await credManager.removeWorkspace('nonexistent')
306
306
 
@@ -308,7 +308,7 @@ describe('Workspace Commands', () => {
308
308
  expect(config.workspaces).toEqual({})
309
309
  })
310
310
 
311
- test('clears current only if removed workspace was current', async () => {
311
+ it('clears current only if removed workspace was current', async () => {
312
312
  const credManager = setup()
313
313
  const ws1: WorkspaceCredentials = {
314
314
  workspace_id: 'T-current-1',
@@ -334,7 +334,7 @@ describe('Workspace Commands', () => {
334
334
  })
335
335
 
336
336
  describe('Output Formatting', () => {
337
- test('formats list output correctly', async () => {
337
+ it('formats list output correctly', async () => {
338
338
  const credManager = setup()
339
339
  const ws1: WorkspaceCredentials = {
340
340
  workspace_id: 'T-format-1',
@@ -366,7 +366,7 @@ describe('Workspace Commands', () => {
366
366
  expect(parsed[1].current).toBe(false)
367
367
  })
368
368
 
369
- test('formats switch output correctly', async () => {
369
+ it('formats switch output correctly', async () => {
370
370
  const credManager = setup()
371
371
  const ws: WorkspaceCredentials = {
372
372
  workspace_id: 'T-switch-format',
@@ -384,7 +384,7 @@ describe('Workspace Commands', () => {
384
384
  expect(parsed.current).toBe('T-switch-format')
385
385
  })
386
386
 
387
- test('formats current output correctly', async () => {
387
+ it('formats current output correctly', async () => {
388
388
  const credManager = setup()
389
389
  const ws: WorkspaceCredentials = {
390
390
  workspace_id: 'T-current-format',
@@ -407,7 +407,7 @@ describe('Workspace Commands', () => {
407
407
  expect(parsed.workspace_name).toBe('current-format')
408
408
  })
409
409
 
410
- test('formats remove output correctly', async () => {
410
+ it('formats remove output correctly', async () => {
411
411
  const credManager = setup()
412
412
  const ws: WorkspaceCredentials = {
413
413
  workspace_id: 'T-remove-format',
@@ -424,7 +424,7 @@ describe('Workspace Commands', () => {
424
424
  expect(parsed.removed).toBe('T-remove-format')
425
425
  })
426
426
 
427
- test('pretty prints JSON correctly', async () => {
427
+ it('pretty prints JSON correctly', async () => {
428
428
  const output = {
429
429
  id: 'T123',
430
430
  name: 'test',
@@ -439,13 +439,13 @@ describe('Workspace Commands', () => {
439
439
  })
440
440
 
441
441
  describe('Error Handling', () => {
442
- test('handles missing workspace gracefully', async () => {
442
+ it('handles missing workspace gracefully', async () => {
443
443
  const credManager = setup()
444
444
  const ws = await credManager.getWorkspace('missing')
445
445
  expect(ws).toBeNull()
446
446
  })
447
447
 
448
- test('handles corrupted config gracefully', async () => {
448
+ it('handles corrupted config gracefully', async () => {
449
449
  const credManager = setup()
450
450
  const config = await credManager.load()
451
451
 
@@ -453,7 +453,7 @@ describe('Workspace Commands', () => {
453
453
  expect(config.workspaces).toEqual({})
454
454
  })
455
455
 
456
- test('handles concurrent operations', async () => {
456
+ it('handles concurrent operations', async () => {
457
457
  const credManager = setup()
458
458
  const ws1: WorkspaceCredentials = {
459
459
  workspace_id: 'T-concurrent-1',