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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -67,7 +67,7 @@ describe('bot commands', () => {
67
67
  })
68
68
 
69
69
  describe('listAction', () => {
70
- test('returns all bots', async () => {
70
+ it('returns all bots', async () => {
71
71
  const manager = new ChannelBotCredentialManager(tempDir)
72
72
  const result = await listAction({ _credManager: manager })
73
73
 
@@ -78,7 +78,7 @@ describe('bot commands', () => {
78
78
  })
79
79
 
80
80
  describe('createAction', () => {
81
- test('creates bot with name', async () => {
81
+ it('creates bot with name', async () => {
82
82
  const manager = new ChannelBotCredentialManager(tempDir)
83
83
  const result = await createAction('New Bot', { _credManager: manager })
84
84
 
@@ -88,7 +88,7 @@ describe('bot commands', () => {
88
88
  expect(capturedCreateArgs[0]).toBe('New Bot')
89
89
  })
90
90
 
91
- test('creates bot with optional color and avatar', async () => {
91
+ it('creates bot with optional color and avatar', async () => {
92
92
  const manager = new ChannelBotCredentialManager(tempDir)
93
93
  await createAction('New Bot', {
94
94
  color: '#00FF00',
@@ -101,7 +101,7 @@ describe('bot commands', () => {
101
101
  })
102
102
 
103
103
  describe('deleteAction', () => {
104
- test('deletes bot with --force flag', async () => {
104
+ it('deletes bot with --force flag', async () => {
105
105
  const manager = new ChannelBotCredentialManager(tempDir)
106
106
  const result = await deleteAction('bot1', { force: true, _credManager: manager })
107
107
 
@@ -111,7 +111,7 @@ describe('bot commands', () => {
111
111
  expect(capturedDeleteArg).toBe('bot1')
112
112
  })
113
113
 
114
- test('returns error without --force flag', async () => {
114
+ it('returns error without --force flag', async () => {
115
115
  const manager = new ChannelBotCredentialManager(tempDir)
116
116
  const result = await deleteAction('bot1', { _credManager: manager })
117
117
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -92,7 +92,7 @@ describe('chat commands', () => {
92
92
  })
93
93
 
94
94
  describe('listAction', () => {
95
- test('lists opened chats by default', async () => {
95
+ it('lists opened chats by default', async () => {
96
96
  const manager = new ChannelBotCredentialManager(tempDir)
97
97
  const result = await listAction({ _credManager: manager })
98
98
 
@@ -102,14 +102,14 @@ describe('chat commands', () => {
102
102
  expect(capturedListArgs[0]).toMatchObject({ state: 'opened' })
103
103
  })
104
104
 
105
- test('passes state filter to API', async () => {
105
+ it('passes state filter to API', async () => {
106
106
  const manager = new ChannelBotCredentialManager(tempDir)
107
107
  await listAction({ state: 'closed', _credManager: manager })
108
108
 
109
109
  expect(capturedListArgs[0]).toMatchObject({ state: 'closed' })
110
110
  })
111
111
 
112
- test('passes pagination params', async () => {
112
+ it('passes pagination params', async () => {
113
113
  const manager = new ChannelBotCredentialManager(tempDir)
114
114
  await listAction({ limit: '10', sort: 'asc', since: 'cursor123', _credManager: manager })
115
115
 
@@ -118,7 +118,7 @@ describe('chat commands', () => {
118
118
  })
119
119
 
120
120
  describe('getAction', () => {
121
- test('returns specific chat', async () => {
121
+ it('returns specific chat', async () => {
122
122
  const manager = new ChannelBotCredentialManager(tempDir)
123
123
  const result = await getAction('chat1', { _credManager: manager })
124
124
 
@@ -129,7 +129,7 @@ describe('chat commands', () => {
129
129
  })
130
130
 
131
131
  describe('closeAction', () => {
132
- test('closes chat with bot name', async () => {
132
+ it('closes chat with bot name', async () => {
133
133
  const manager = new ChannelBotCredentialManager(tempDir)
134
134
  const result = await closeAction('chat1', { bot: 'my-bot', _credManager: manager })
135
135
 
@@ -138,7 +138,7 @@ describe('chat commands', () => {
138
138
  expect(capturedCloseArgs[1]).toBe('my-bot')
139
139
  })
140
140
 
141
- test('returns error when no bot name provided', async () => {
141
+ it('returns error when no bot name provided', async () => {
142
142
  const manager = new ChannelBotCredentialManager(tempDir)
143
143
  const result = await closeAction('chat1', { _credManager: manager })
144
144
 
@@ -148,7 +148,7 @@ describe('chat commands', () => {
148
148
  })
149
149
 
150
150
  describe('deleteAction', () => {
151
- test('deletes chat with --force flag', async () => {
151
+ it('deletes chat with --force flag', async () => {
152
152
  const manager = new ChannelBotCredentialManager(tempDir)
153
153
  const result = await deleteAction('chat1', { force: true, _credManager: manager })
154
154
 
@@ -157,7 +157,7 @@ describe('chat commands', () => {
157
157
  expect(result.deleted).toBe('chat1')
158
158
  })
159
159
 
160
- test('returns error without --force flag', async () => {
160
+ it('returns error without --force flag', async () => {
161
161
  const manager = new ChannelBotCredentialManager(tempDir)
162
162
  const result = await deleteAction('chat1', { _credManager: manager })
163
163
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -86,7 +86,7 @@ describe('group commands', () => {
86
86
  })
87
87
 
88
88
  describe('listAction', () => {
89
- test('lists all groups', async () => {
89
+ it('lists all groups', async () => {
90
90
  const manager = new ChannelBotCredentialManager(tempDir)
91
91
  const result = await listAction({ _credManager: manager })
92
92
 
@@ -97,7 +97,7 @@ describe('group commands', () => {
97
97
  })
98
98
 
99
99
  describe('getAction', () => {
100
- test('resolves group by ID', async () => {
100
+ it('resolves group by ID', async () => {
101
101
  const manager = new ChannelBotCredentialManager(tempDir)
102
102
  const result = await getAction('grp1', { _credManager: manager })
103
103
 
@@ -106,7 +106,7 @@ describe('group commands', () => {
106
106
  expect(capturedResolveArg).toBe('grp1')
107
107
  })
108
108
 
109
- test('resolves group by @name', async () => {
109
+ it('resolves group by @name', async () => {
110
110
  const manager = new ChannelBotCredentialManager(tempDir)
111
111
  const result = await getAction('@team-alpha', { _credManager: manager })
112
112
 
@@ -116,7 +116,7 @@ describe('group commands', () => {
116
116
  })
117
117
 
118
118
  describe('messagesAction', () => {
119
- test('gets messages from group', async () => {
119
+ it('gets messages from group', async () => {
120
120
  const manager = new ChannelBotCredentialManager(tempDir)
121
121
  const result = await messagesAction('grp1', { _credManager: manager })
122
122
 
@@ -125,7 +125,7 @@ describe('group commands', () => {
125
125
  expect(result.messages?.[0].id).toBe('msg1')
126
126
  })
127
127
 
128
- test('resolves group by @name before fetching messages', async () => {
128
+ it('resolves group by @name before fetching messages', async () => {
129
129
  const manager = new ChannelBotCredentialManager(tempDir)
130
130
  await messagesAction('@team-alpha', { _credManager: manager })
131
131
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -48,7 +48,7 @@ describe('manager commands', () => {
48
48
  })
49
49
 
50
50
  describe('listAction', () => {
51
- test('returns all managers with id, name, description', async () => {
51
+ it('returns all managers with id, name, description', async () => {
52
52
  const manager = new ChannelBotCredentialManager(tempDir)
53
53
  const result = await listAction({ _credManager: manager })
54
54
 
@@ -60,7 +60,7 @@ describe('manager commands', () => {
60
60
  })
61
61
 
62
62
  describe('getAction', () => {
63
- test('returns specific manager', async () => {
63
+ it('returns specific manager', async () => {
64
64
  const manager = new ChannelBotCredentialManager(tempDir)
65
65
  const result = await getAction('mgr1', { _credManager: manager })
66
66
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -113,7 +113,7 @@ describe('message commands', () => {
113
113
  })
114
114
 
115
115
  describe('sendAction', () => {
116
- test('sends to userchat and wraps text in blocks', async () => {
116
+ it('sends to userchat and wraps text in blocks', async () => {
117
117
  const manager = new ChannelBotCredentialManager(tempDir)
118
118
  const result = await sendAction('chat1', 'Hello world', { type: 'userchat', _credManager: manager })
119
119
 
@@ -122,7 +122,7 @@ describe('message commands', () => {
122
122
  expect(capturedSendUserChatArgs[1]).toEqual([{ type: 'text', value: 'Hello world' }])
123
123
  })
124
124
 
125
- test('sends to group when type=group', async () => {
125
+ it('sends to group when type=group', async () => {
126
126
  const manager = new ChannelBotCredentialManager(tempDir)
127
127
  const result = await sendAction('grp1', 'Hello group', { type: 'group', _credManager: manager })
128
128
 
@@ -131,14 +131,14 @@ describe('message commands', () => {
131
131
  expect(mockSendGroupMessage).toHaveBeenCalledTimes(1)
132
132
  })
133
133
 
134
- test('includes botName in request when --bot provided', async () => {
134
+ it('includes botName in request when --bot provided', async () => {
135
135
  const manager = new ChannelBotCredentialManager(tempDir)
136
136
  await sendAction('chat1', 'Hello', { type: 'userchat', bot: 'my-bot', _credManager: manager })
137
137
 
138
138
  expect(capturedSendUserChatArgs[2]).toBe('my-bot')
139
139
  })
140
140
 
141
- test('auto-detects group target from @ prefix', async () => {
141
+ it('auto-detects group target from @ prefix', async () => {
142
142
  const manager = new ChannelBotCredentialManager(tempDir)
143
143
  await sendAction('@team', 'Hello', { _credManager: manager })
144
144
 
@@ -147,7 +147,7 @@ describe('message commands', () => {
147
147
  })
148
148
 
149
149
  describe('listAction', () => {
150
- test('lists userchat messages', async () => {
150
+ it('lists userchat messages', async () => {
151
151
  const manager = new ChannelBotCredentialManager(tempDir)
152
152
  const result = await listAction('chat1', { type: 'userchat', _credManager: manager })
153
153
 
@@ -156,7 +156,7 @@ describe('message commands', () => {
156
156
  expect(result.messages?.[0].id).toBe('msg1')
157
157
  })
158
158
 
159
- test('lists group messages when type=group', async () => {
159
+ it('lists group messages when type=group', async () => {
160
160
  const manager = new ChannelBotCredentialManager(tempDir)
161
161
  const result = await listAction('grp1', { type: 'group', _credManager: manager })
162
162
 
@@ -165,7 +165,7 @@ describe('message commands', () => {
165
165
  expect(result.messages?.[0].id).toBe('msg2')
166
166
  })
167
167
 
168
- test('passes pagination params', async () => {
168
+ it('passes pagination params', async () => {
169
169
  const manager = new ChannelBotCredentialManager(tempDir)
170
170
  await listAction('chat1', {
171
171
  type: 'userchat',
@@ -181,7 +181,7 @@ describe('message commands', () => {
181
181
  })
182
182
 
183
183
  describe('getAction', () => {
184
- test('returns specific message by ID', async () => {
184
+ it('returns specific message by ID', async () => {
185
185
  const manager = new ChannelBotCredentialManager(tempDir)
186
186
  const result = await getAction('chat1', 'msg1', { type: 'userchat', _credManager: manager })
187
187
 
@@ -189,7 +189,7 @@ describe('message commands', () => {
189
189
  expect(result.id).toBe('msg1')
190
190
  })
191
191
 
192
- test('returns error when message not found', async () => {
192
+ it('returns error when message not found', async () => {
193
193
  const manager = new ChannelBotCredentialManager(tempDir)
194
194
  const result = await getAction('chat1', 'nonexistent', { type: 'userchat', _credManager: manager })
195
195
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -67,7 +67,7 @@ describe('snapshot command', () => {
67
67
  })
68
68
 
69
69
  describe('snapshotAction', () => {
70
- test('brief snapshot returns workspace, groups (names), chat counts, and hint', async () => {
70
+ it('brief snapshot returns workspace, groups (names), chat counts, and hint', async () => {
71
71
  const manager = new ChannelBotCredentialManager(tempDir)
72
72
  const result = await snapshotAction({ _credManager: manager })
73
73
 
@@ -85,7 +85,7 @@ describe('snapshot command', () => {
85
85
  expect(mockGetGroupMessages).not.toHaveBeenCalled()
86
86
  })
87
87
 
88
- test('full snapshot returns workspace, groups, user_chats, managers, bots', async () => {
88
+ it('full snapshot returns workspace, groups, user_chats, managers, bots', async () => {
89
89
  const manager = new ChannelBotCredentialManager(tempDir)
90
90
  const result = await snapshotAction({ full: true, _credManager: manager })
91
91
 
@@ -99,7 +99,7 @@ describe('snapshot command', () => {
99
99
  expect(result.bots).toBeDefined()
100
100
  })
101
101
 
102
- test('groups-only flag skips user_chats, managers, bots', async () => {
102
+ it('groups-only flag skips user_chats, managers, bots', async () => {
103
103
  const manager = new ChannelBotCredentialManager(tempDir)
104
104
  const result = await snapshotAction({ full: true, groupsOnly: true, _credManager: manager })
105
105
 
@@ -111,7 +111,7 @@ describe('snapshot command', () => {
111
111
  expect(result.bots).toBeUndefined()
112
112
  })
113
113
 
114
- test('chats-only flag skips groups, managers, bots', async () => {
114
+ it('chats-only flag skips groups, managers, bots', async () => {
115
115
  const manager = new ChannelBotCredentialManager(tempDir)
116
116
  const result = await snapshotAction({ full: true, chatsOnly: true, _credManager: manager })
117
117
 
@@ -123,7 +123,7 @@ describe('snapshot command', () => {
123
123
  expect(result.bots).toBeUndefined()
124
124
  })
125
125
 
126
- test('full groups include recent messages', async () => {
126
+ it('full groups include recent messages', async () => {
127
127
  const manager = new ChannelBotCredentialManager(tempDir)
128
128
  const result = await snapshotAction({ full: true, groupsOnly: true, limit: 3, _credManager: manager })
129
129
 
@@ -131,7 +131,7 @@ describe('snapshot command', () => {
131
131
  expect(result.groups?.[0].messages?.[0].id).toBe('msg1')
132
132
  })
133
133
 
134
- test('full user_chats includes counts and recent opened', async () => {
134
+ it('full user_chats includes counts and recent opened', async () => {
135
135
  const manager = new ChannelBotCredentialManager(tempDir)
136
136
  const result = await snapshotAction({ full: true, chatsOnly: true, _credManager: manager })
137
137
 
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -45,7 +45,7 @@ describe('whoami command', () => {
45
45
  process.env = originalEnv
46
46
  })
47
47
 
48
- test('returns channel info for current workspace', async () => {
48
+ it('returns channel info for current workspace', async () => {
49
49
  const manager = new ChannelBotCredentialManager(tempDir)
50
50
  await manager.setCredentials({
51
51
  workspace_id: 'workspace1',
@@ -63,7 +63,7 @@ describe('whoami command', () => {
63
63
  expect(result.error).toBeUndefined()
64
64
  })
65
65
 
66
- test('returns channel info for specific --workspace', async () => {
66
+ it('returns channel info for specific --workspace', async () => {
67
67
  const manager = new ChannelBotCredentialManager(tempDir)
68
68
  await manager.setCredentials({
69
69
  workspace_id: 'workspace1',
@@ -85,7 +85,7 @@ describe('whoami command', () => {
85
85
  expect(mockGetChannel).toHaveBeenCalledTimes(1)
86
86
  })
87
87
 
88
- test('returns error when client throws', async () => {
88
+ it('returns error when client throws', async () => {
89
89
  mockGetChannel.mockImplementationOnce(() => Promise.reject(new Error('API Error')))
90
90
 
91
91
  const manager = new ChannelBotCredentialManager(tempDir)
@@ -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
  import { existsSync, rmSync } from 'node:fs'
3
3
  import { mkdir, stat } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
@@ -39,7 +39,7 @@ describe('ChannelBotCredentialManager', () => {
39
39
  })
40
40
 
41
41
  describe('load', () => {
42
- test('returns empty config when no file exists', async () => {
42
+ it('returns empty config when no file exists', async () => {
43
43
  const config = await manager.load()
44
44
 
45
45
  expect(config.current).toBeNull()
@@ -49,7 +49,7 @@ describe('ChannelBotCredentialManager', () => {
49
49
  })
50
50
 
51
51
  describe('save and load', () => {
52
- test('persists config to file', async () => {
52
+ it('persists config to file', async () => {
53
53
  const config = {
54
54
  current: { workspace_id: 'ch_abc123' },
55
55
  workspaces: {
@@ -71,11 +71,11 @@ describe('ChannelBotCredentialManager', () => {
71
71
  })
72
72
 
73
73
  describe('getCredentials', () => {
74
- test('returns null when no credentials exist', async () => {
74
+ it('returns null when no credentials exist', async () => {
75
75
  expect(await manager.getCredentials()).toBeNull()
76
76
  })
77
77
 
78
- test('returns current workspace credentials', async () => {
78
+ it('returns current workspace credentials', async () => {
79
79
  await manager.setCredentials(WORKSPACE_A)
80
80
 
81
81
  const creds = await manager.getCredentials()
@@ -83,7 +83,7 @@ describe('ChannelBotCredentialManager', () => {
83
83
  expect(creds).toEqual(WORKSPACE_A)
84
84
  })
85
85
 
86
- test('returns specific workspace by id', async () => {
86
+ it('returns specific workspace by id', async () => {
87
87
  await manager.setCredentials(WORKSPACE_A)
88
88
  await manager.setCredentials(WORKSPACE_B)
89
89
 
@@ -92,7 +92,7 @@ describe('ChannelBotCredentialManager', () => {
92
92
  expect(creds).toEqual(WORKSPACE_A)
93
93
  })
94
94
 
95
- test('returns null for non-existent workspace id', async () => {
95
+ it('returns null for non-existent workspace id', async () => {
96
96
  await manager.setCredentials(WORKSPACE_A)
97
97
 
98
98
  const creds = await manager.getCredentials('nonexistent')
@@ -100,7 +100,7 @@ describe('ChannelBotCredentialManager', () => {
100
100
  expect(creds).toBeNull()
101
101
  })
102
102
 
103
- test('env vars take precedence when no workspaceId specified', async () => {
103
+ it('env vars take precedence when no workspaceId specified', async () => {
104
104
  await manager.setCredentials(WORKSPACE_A)
105
105
 
106
106
  process.env.E2E_CHANNELBOT_ACCESS_KEY = 'env-key'
@@ -114,7 +114,7 @@ describe('ChannelBotCredentialManager', () => {
114
114
  expect(creds?.workspace_name).toBe('env')
115
115
  })
116
116
 
117
- test('env vars ignored when workspaceId explicitly provided', async () => {
117
+ it('env vars ignored when workspaceId explicitly provided', async () => {
118
118
  await manager.setCredentials(WORKSPACE_A)
119
119
 
120
120
  process.env.E2E_CHANNELBOT_ACCESS_KEY = 'env-key'
@@ -129,7 +129,7 @@ describe('ChannelBotCredentialManager', () => {
129
129
  })
130
130
 
131
131
  describe('setCredentials', () => {
132
- test('stores workspace and sets as current', async () => {
132
+ it('stores workspace and sets as current', async () => {
133
133
  await manager.setCredentials(WORKSPACE_A)
134
134
 
135
135
  const config = await manager.load()
@@ -137,7 +137,7 @@ describe('ChannelBotCredentialManager', () => {
137
137
  expect(config.workspaces['ch_abc123']).toEqual(WORKSPACE_A)
138
138
  })
139
139
 
140
- test('stores multiple workspaces', async () => {
140
+ it('stores multiple workspaces', async () => {
141
141
  await manager.setCredentials(WORKSPACE_A)
142
142
  await manager.setCredentials(WORKSPACE_B)
143
143
 
@@ -146,7 +146,7 @@ describe('ChannelBotCredentialManager', () => {
146
146
  expect(config.current).toEqual({ workspace_id: 'ch_def456' })
147
147
  })
148
148
 
149
- test('overwrites existing workspace with same id', async () => {
149
+ it('overwrites existing workspace with same id', async () => {
150
150
  await manager.setCredentials(WORKSPACE_A)
151
151
  const updated = { ...WORKSPACE_A, workspace_name: 'Updated Company A' }
152
152
  await manager.setCredentials(updated)
@@ -158,7 +158,7 @@ describe('ChannelBotCredentialManager', () => {
158
158
  })
159
159
 
160
160
  describe('listAll', () => {
161
- test('returns all workspaces with current flag', async () => {
161
+ it('returns all workspaces with current flag', async () => {
162
162
  await manager.setCredentials(WORKSPACE_A)
163
163
  await manager.setCredentials(WORKSPACE_B)
164
164
 
@@ -169,7 +169,7 @@ describe('ChannelBotCredentialManager', () => {
169
169
  expect(all.find((w) => w.workspace_id === 'ch_def456')?.is_current).toBe(true)
170
170
  })
171
171
 
172
- test('returns empty array when no workspaces exist', async () => {
172
+ it('returns empty array when no workspaces exist', async () => {
173
173
  const all = await manager.listAll()
174
174
 
175
175
  expect(all).toEqual([])
@@ -177,7 +177,7 @@ describe('ChannelBotCredentialManager', () => {
177
177
  })
178
178
 
179
179
  describe('setCurrent', () => {
180
- test('switches current workspace', async () => {
180
+ it('switches current workspace', async () => {
181
181
  await manager.setCredentials(WORKSPACE_A)
182
182
  await manager.setCredentials(WORKSPACE_B)
183
183
 
@@ -188,13 +188,13 @@ describe('ChannelBotCredentialManager', () => {
188
188
  expect(creds?.workspace_id).toBe('ch_abc123')
189
189
  })
190
190
 
191
- test('returns false for unknown workspace', async () => {
191
+ it('returns false for unknown workspace', async () => {
192
192
  expect(await manager.setCurrent('nonexistent')).toBe(false)
193
193
  })
194
194
  })
195
195
 
196
196
  describe('removeWorkspace', () => {
197
- test('removes a workspace by id', async () => {
197
+ it('removes a workspace by id', async () => {
198
198
  await manager.setCredentials(WORKSPACE_A)
199
199
  await manager.setCredentials(WORKSPACE_B)
200
200
 
@@ -205,7 +205,7 @@ describe('ChannelBotCredentialManager', () => {
205
205
  expect(Object.keys(config.workspaces)).toEqual(['ch_def456'])
206
206
  })
207
207
 
208
- test('clears current when current workspace removed', async () => {
208
+ it('clears current when current workspace removed', async () => {
209
209
  await manager.setCredentials(WORKSPACE_A)
210
210
 
211
211
  await manager.removeWorkspace('ch_abc123')
@@ -214,11 +214,11 @@ describe('ChannelBotCredentialManager', () => {
214
214
  expect(config.current).toBeNull()
215
215
  })
216
216
 
217
- test('returns false for unknown workspace', async () => {
217
+ it('returns false for unknown workspace', async () => {
218
218
  expect(await manager.removeWorkspace('nonexistent')).toBe(false)
219
219
  })
220
220
 
221
- test('does not clear current if removing non-current workspace', async () => {
221
+ it('does not clear current if removing non-current workspace', async () => {
222
222
  await manager.setCredentials(WORKSPACE_A)
223
223
  await manager.setCredentials(WORKSPACE_B)
224
224
 
@@ -230,7 +230,7 @@ describe('ChannelBotCredentialManager', () => {
230
230
  })
231
231
 
232
232
  describe('clearCredentials', () => {
233
- test('removes all credentials', async () => {
233
+ it('removes all credentials', async () => {
234
234
  await manager.setCredentials(WORKSPACE_A)
235
235
  await manager.setCredentials(WORKSPACE_B)
236
236
 
@@ -244,13 +244,13 @@ describe('ChannelBotCredentialManager', () => {
244
244
  })
245
245
 
246
246
  describe('getDefaultBot', () => {
247
- test('returns null initially', async () => {
247
+ it('returns null initially', async () => {
248
248
  const bot = await manager.getDefaultBot()
249
249
 
250
250
  expect(bot).toBeNull()
251
251
  })
252
252
 
253
- test('returns default bot name', async () => {
253
+ it('returns default bot name', async () => {
254
254
  await manager.setDefaultBot('my-bot')
255
255
 
256
256
  const bot = await manager.getDefaultBot()
@@ -260,7 +260,7 @@ describe('ChannelBotCredentialManager', () => {
260
260
  })
261
261
 
262
262
  describe('setDefaultBot', () => {
263
- test('saves and retrieves default bot', async () => {
263
+ it('saves and retrieves default bot', async () => {
264
264
  await manager.setDefaultBot('my-bot')
265
265
 
266
266
  const bot = await manager.getDefaultBot()
@@ -268,7 +268,7 @@ describe('ChannelBotCredentialManager', () => {
268
268
  expect(bot).toBe('my-bot')
269
269
  })
270
270
 
271
- test('updates existing default bot', async () => {
271
+ it('updates existing default bot', async () => {
272
272
  await manager.setDefaultBot('bot-1')
273
273
  await manager.setDefaultBot('bot-2')
274
274
 
@@ -277,7 +277,7 @@ describe('ChannelBotCredentialManager', () => {
277
277
  expect(bot).toBe('bot-2')
278
278
  })
279
279
 
280
- test('scopes default bot to current workspace', async () => {
280
+ it('scopes default bot to current workspace', async () => {
281
281
  // given
282
282
  await manager.setCredentials(WORKSPACE_A)
283
283
  await manager.setDefaultBot('bot-a')
@@ -296,7 +296,7 @@ describe('ChannelBotCredentialManager', () => {
296
296
  })
297
297
 
298
298
  describe('file permissions', () => {
299
- test('saves file with secure permissions (600)', async () => {
299
+ it('saves file with secure permissions (600)', async () => {
300
300
  await manager.setCredentials(WORKSPACE_A)
301
301
 
302
302
  const credPath = join(tempDir, 'channelbot-credentials.json')