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 { expect, test } from 'bun:test'
1
+ import { expect, it } from 'bun:test'
2
2
 
3
3
  import {
4
4
  TeamsChannelSchema,
@@ -13,7 +13,7 @@ import {
13
13
  } from './types'
14
14
 
15
15
  // TeamsTeamSchema tests
16
- test('TeamsTeamSchema validates correct team', () => {
16
+ it('TeamsTeamSchema validates correct team', () => {
17
17
  const result = TeamsTeamSchema.safeParse({
18
18
  id: '19:abc123@thread.tacv2',
19
19
  name: 'Test Team',
@@ -21,7 +21,7 @@ test('TeamsTeamSchema validates correct team', () => {
21
21
  expect(result.success).toBe(true)
22
22
  })
23
23
 
24
- test('TeamsTeamSchema validates team with optional description', () => {
24
+ it('TeamsTeamSchema validates team with optional description', () => {
25
25
  const result = TeamsTeamSchema.safeParse({
26
26
  id: '19:abc123@thread.tacv2',
27
27
  name: 'Test Team',
@@ -30,14 +30,14 @@ test('TeamsTeamSchema validates team with optional description', () => {
30
30
  expect(result.success).toBe(true)
31
31
  })
32
32
 
33
- test('TeamsTeamSchema rejects missing id', () => {
33
+ it('TeamsTeamSchema rejects missing id', () => {
34
34
  const result = TeamsTeamSchema.safeParse({
35
35
  name: 'Test Team',
36
36
  })
37
37
  expect(result.success).toBe(false)
38
38
  })
39
39
 
40
- test('TeamsTeamSchema rejects missing name', () => {
40
+ it('TeamsTeamSchema rejects missing name', () => {
41
41
  const result = TeamsTeamSchema.safeParse({
42
42
  id: '19:abc123@thread.tacv2',
43
43
  })
@@ -45,7 +45,7 @@ test('TeamsTeamSchema rejects missing name', () => {
45
45
  })
46
46
 
47
47
  // TeamsChannelSchema tests
48
- test('TeamsChannelSchema validates correct channel', () => {
48
+ it('TeamsChannelSchema validates correct channel', () => {
49
49
  const result = TeamsChannelSchema.safeParse({
50
50
  id: '19:channel123@thread.tacv2',
51
51
  team_id: '19:abc123@thread.tacv2',
@@ -55,7 +55,7 @@ test('TeamsChannelSchema validates correct channel', () => {
55
55
  expect(result.success).toBe(true)
56
56
  })
57
57
 
58
- test('TeamsChannelSchema rejects missing required fields', () => {
58
+ it('TeamsChannelSchema rejects missing required fields', () => {
59
59
  const result = TeamsChannelSchema.safeParse({
60
60
  id: '19:channel123@thread.tacv2',
61
61
  name: 'General',
@@ -64,7 +64,7 @@ test('TeamsChannelSchema rejects missing required fields', () => {
64
64
  })
65
65
 
66
66
  // TeamsMessageSchema tests
67
- test('TeamsMessageSchema validates correct message', () => {
67
+ it('TeamsMessageSchema validates correct message', () => {
68
68
  const result = TeamsMessageSchema.safeParse({
69
69
  id: '1234567890123',
70
70
  channel_id: '19:channel123@thread.tacv2',
@@ -78,7 +78,7 @@ test('TeamsMessageSchema validates correct message', () => {
78
78
  expect(result.success).toBe(true)
79
79
  })
80
80
 
81
- test('TeamsMessageSchema rejects missing required fields', () => {
81
+ it('TeamsMessageSchema rejects missing required fields', () => {
82
82
  const result = TeamsMessageSchema.safeParse({
83
83
  id: '1234567890123',
84
84
  channel_id: '19:channel123@thread.tacv2',
@@ -88,7 +88,7 @@ test('TeamsMessageSchema rejects missing required fields', () => {
88
88
  })
89
89
 
90
90
  // TeamsUserSchema tests
91
- test('TeamsUserSchema validates correct user', () => {
91
+ it('TeamsUserSchema validates correct user', () => {
92
92
  const result = TeamsUserSchema.safeParse({
93
93
  id: 'user123',
94
94
  displayName: 'Test User',
@@ -96,7 +96,7 @@ test('TeamsUserSchema validates correct user', () => {
96
96
  expect(result.success).toBe(true)
97
97
  })
98
98
 
99
- test('TeamsUserSchema validates user with optional fields', () => {
99
+ it('TeamsUserSchema validates user with optional fields', () => {
100
100
  const result = TeamsUserSchema.safeParse({
101
101
  id: 'user123',
102
102
  displayName: 'Test User',
@@ -106,7 +106,7 @@ test('TeamsUserSchema validates user with optional fields', () => {
106
106
  expect(result.success).toBe(true)
107
107
  })
108
108
 
109
- test('TeamsUserSchema rejects missing required fields', () => {
109
+ it('TeamsUserSchema rejects missing required fields', () => {
110
110
  const result = TeamsUserSchema.safeParse({
111
111
  id: 'user123',
112
112
  })
@@ -114,7 +114,7 @@ test('TeamsUserSchema rejects missing required fields', () => {
114
114
  })
115
115
 
116
116
  // TeamsReactionSchema tests
117
- test('TeamsReactionSchema validates correct reaction', () => {
117
+ it('TeamsReactionSchema validates correct reaction', () => {
118
118
  const result = TeamsReactionSchema.safeParse({
119
119
  emoji: 'like',
120
120
  count: 5,
@@ -122,7 +122,7 @@ test('TeamsReactionSchema validates correct reaction', () => {
122
122
  expect(result.success).toBe(true)
123
123
  })
124
124
 
125
- test('TeamsReactionSchema rejects missing required fields', () => {
125
+ it('TeamsReactionSchema rejects missing required fields', () => {
126
126
  const result = TeamsReactionSchema.safeParse({
127
127
  emoji: 'like',
128
128
  })
@@ -130,7 +130,7 @@ test('TeamsReactionSchema rejects missing required fields', () => {
130
130
  })
131
131
 
132
132
  // TeamsFileSchema tests
133
- test('TeamsFileSchema validates correct file', () => {
133
+ it('TeamsFileSchema validates correct file', () => {
134
134
  const result = TeamsFileSchema.safeParse({
135
135
  id: 'file123',
136
136
  name: 'document.pdf',
@@ -140,7 +140,7 @@ test('TeamsFileSchema validates correct file', () => {
140
140
  expect(result.success).toBe(true)
141
141
  })
142
142
 
143
- test('TeamsFileSchema validates file with optional contentType', () => {
143
+ it('TeamsFileSchema validates file with optional contentType', () => {
144
144
  const result = TeamsFileSchema.safeParse({
145
145
  id: 'file123',
146
146
  name: 'document.pdf',
@@ -151,7 +151,7 @@ test('TeamsFileSchema validates file with optional contentType', () => {
151
151
  expect(result.success).toBe(true)
152
152
  })
153
153
 
154
- test('TeamsFileSchema rejects missing required fields', () => {
154
+ it('TeamsFileSchema rejects missing required fields', () => {
155
155
  const result = TeamsFileSchema.safeParse({
156
156
  id: 'file123',
157
157
  name: 'document.pdf',
@@ -160,14 +160,14 @@ test('TeamsFileSchema rejects missing required fields', () => {
160
160
  })
161
161
 
162
162
  // TeamsCredentialsSchema tests
163
- test('TeamsCredentialsSchema validates correct credentials', () => {
163
+ it('TeamsCredentialsSchema validates correct credentials', () => {
164
164
  const result = TeamsCredentialsSchema.safeParse({
165
165
  token: 'skypetoken_value',
166
166
  })
167
167
  expect(result.success).toBe(true)
168
168
  })
169
169
 
170
- test('TeamsCredentialsSchema validates credentials with cookie', () => {
170
+ it('TeamsCredentialsSchema validates credentials with cookie', () => {
171
171
  const result = TeamsCredentialsSchema.safeParse({
172
172
  token: 'skypetoken_value',
173
173
  cookie: 'skypetoken_asm_value',
@@ -175,13 +175,13 @@ test('TeamsCredentialsSchema validates credentials with cookie', () => {
175
175
  expect(result.success).toBe(true)
176
176
  })
177
177
 
178
- test('TeamsCredentialsSchema rejects missing token', () => {
178
+ it('TeamsCredentialsSchema rejects missing token', () => {
179
179
  const result = TeamsCredentialsSchema.safeParse({})
180
180
  expect(result.success).toBe(false)
181
181
  })
182
182
 
183
183
  // TeamsConfigSchema tests
184
- test('TeamsConfigSchema validates correct config', () => {
184
+ it('TeamsConfigSchema validates correct config', () => {
185
185
  const result = TeamsConfigSchema.safeParse({
186
186
  current_account: 'work',
187
187
  accounts: {
@@ -196,7 +196,7 @@ test('TeamsConfigSchema validates correct config', () => {
196
196
  expect(result.success).toBe(true)
197
197
  })
198
198
 
199
- test('TeamsConfigSchema validates config with multiple accounts', () => {
199
+ it('TeamsConfigSchema validates config with multiple accounts', () => {
200
200
  const result = TeamsConfigSchema.safeParse({
201
201
  current_account: 'work',
202
202
  accounts: {
@@ -225,7 +225,7 @@ test('TeamsConfigSchema validates config with multiple accounts', () => {
225
225
  expect(result.success).toBe(true)
226
226
  })
227
227
 
228
- test('TeamsConfigSchema rejects invalid region', () => {
228
+ it('TeamsConfigSchema rejects invalid region', () => {
229
229
  const result = TeamsConfigSchema.safeParse({
230
230
  current_account: 'work',
231
231
  accounts: {
@@ -241,7 +241,7 @@ test('TeamsConfigSchema rejects invalid region', () => {
241
241
  expect(result.success).toBe(false)
242
242
  })
243
243
 
244
- test('TeamsConfigSchema rejects missing required fields', () => {
244
+ it('TeamsConfigSchema rejects missing required fields', () => {
245
245
  const result = TeamsConfigSchema.safeParse({
246
246
  current_account: null,
247
247
  })
@@ -249,14 +249,14 @@ test('TeamsConfigSchema rejects missing required fields', () => {
249
249
  })
250
250
 
251
251
  // TeamsError tests
252
- test('TeamsError has correct name and code', () => {
252
+ it('TeamsError has correct name and code', () => {
253
253
  const error = new TeamsError('Test error', 'TEST_CODE')
254
254
  expect(error.name).toBe('TeamsError')
255
255
  expect(error.message).toBe('Test error')
256
256
  expect(error.code).toBe('TEST_CODE')
257
257
  })
258
258
 
259
- test('TeamsError is instance of Error', () => {
259
+ it('TeamsError is instance of Error', () => {
260
260
  const error = new TeamsError('Test error', 'TEST_CODE')
261
261
  expect(error instanceof Error).toBe(true)
262
262
  })
@@ -1,4 +1,4 @@
1
- import { beforeEach, describe, expect, test } from 'bun:test'
1
+ import { beforeEach, describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { getTelegramAppCredentials } from './app-config'
4
4
 
@@ -16,7 +16,7 @@ describe('telegram app config', () => {
16
16
  }
17
17
  })
18
18
 
19
- test('returns env credentials when provided', () => {
19
+ it('returns env credentials when provided', () => {
20
20
  process.env.AGENT_TELEGRAM_API_ID = '12345'
21
21
  process.env.AGENT_TELEGRAM_API_HASH = 'secret'
22
22
 
@@ -27,11 +27,11 @@ describe('telegram app config', () => {
27
27
  })
28
28
  })
29
29
 
30
- test('returns none when nothing is configured', () => {
30
+ it('returns none when nothing is configured', () => {
31
31
  expect(getTelegramAppCredentials()).toEqual({ source: 'none' })
32
32
  })
33
33
 
34
- test('rejects malformed api_id like "123abc"', () => {
34
+ it('rejects malformed api_id like "123abc"', () => {
35
35
  const prev = process.env.AGENT_TELEGRAM_API_ID
36
36
  process.env.AGENT_TELEGRAM_API_ID = '123abc'
37
37
  process.env.AGENT_TELEGRAM_API_HASH = 'abc123'
@@ -1,21 +1,21 @@
1
- import { describe, expect, test } from 'bun:test'
1
+ import { describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { findFuzzyChats, mergeChats, normalizeChatSearchText } from './chat-utils'
4
4
 
5
5
  describe('normalizeChatSearchText', () => {
6
- test('lowercases and strips spaces', () => {
6
+ it('lowercases and strips spaces', () => {
7
7
  expect(normalizeChatSearchText('Hello World')).toBe('helloworld')
8
8
  })
9
9
 
10
- test('strips special chars', () => {
10
+ it('strips special chars', () => {
11
11
  expect(normalizeChatSearchText('ops-alerts!')).toBe('opsalerts')
12
12
  })
13
13
 
14
- test('handles empty string', () => {
14
+ it('handles empty string', () => {
15
15
  expect(normalizeChatSearchText('')).toBe('')
16
16
  })
17
17
 
18
- test('preserves unicode letters and digits', () => {
18
+ it('preserves unicode letters and digits', () => {
19
19
  const result = normalizeChatSearchText('안녕 World 123')
20
20
  expect(result).toContain('안녕')
21
21
  expect(result).toContain('world')
@@ -30,26 +30,26 @@ describe('findFuzzyChats', () => {
30
30
  { id: 3, title: 'ops-team', type: 'group' },
31
31
  ] as any[]
32
32
 
33
- test('finds partial matches case-insensitively', () => {
33
+ it('finds partial matches case-insensitively', () => {
34
34
  const result = findFuzzyChats(chats, 'ops', 10)
35
35
  expect(result.map((c) => c.id)).toContain(1)
36
36
  expect(result.map((c) => c.id)).toContain(3)
37
37
  })
38
38
 
39
- test('returns empty for no matches', () => {
39
+ it('returns empty for no matches', () => {
40
40
  expect(findFuzzyChats(chats, 'zzz', 10)).toHaveLength(0)
41
41
  })
42
42
 
43
- test('returns empty for empty query', () => {
43
+ it('returns empty for empty query', () => {
44
44
  expect(findFuzzyChats(chats, '', 10)).toHaveLength(0)
45
45
  })
46
46
 
47
- test('respects limit', () => {
47
+ it('respects limit', () => {
48
48
  const result = findFuzzyChats(chats, 'o', 1)
49
49
  expect(result).toHaveLength(1)
50
50
  })
51
51
 
52
- test('does not match chats with empty normalized title', () => {
52
+ it('does not match chats with empty normalized title', () => {
53
53
  const chats = [{ id: 99, title: '---', type: 'group' }] as any[]
54
54
  expect(findFuzzyChats(chats, 'ops', 10)).toHaveLength(0)
55
55
  })
@@ -62,13 +62,13 @@ describe('mergeChats', () => {
62
62
  { id: 2, title: 'B', type: 'group' },
63
63
  ] as any[]
64
64
 
65
- test('deduplicates by id', () => {
65
+ it('deduplicates by id', () => {
66
66
  const result = mergeChats(a, b)
67
67
  expect(result).toHaveLength(2)
68
68
  expect(result.map((c) => c.id)).toEqual([1, 2])
69
69
  })
70
70
 
71
- test('primary takes precedence order', () => {
71
+ it('gives primary array precedence in order', () => {
72
72
  const result = mergeChats(a, b)
73
73
  expect(result[0].id).toBe(1)
74
74
  })
@@ -1,4 +1,4 @@
1
- import { describe, expect, mock, test } from 'bun:test'
1
+ import { describe, expect, mock, it } from 'bun:test'
2
2
 
3
3
  import { TelegramTdlibClient } from './client'
4
4
  import type { TelegramAccount, TelegramAccountPaths } from './types'
@@ -46,7 +46,7 @@ function pushAuthReady(events: any[], extra: string) {
46
46
  }
47
47
 
48
48
  describe('listChats', () => {
49
- test('loads chats across multiple loadChats calls until 404', async () => {
49
+ it('loads chats across multiple loadChats calls until 404', async () => {
50
50
  let loadChatsCallCount = 0
51
51
  const allChatIds = [1, 2, 3, 4, 5]
52
52
 
@@ -116,7 +116,7 @@ describe('listChats', () => {
116
116
  expect(loadChatsCallCount).toBe(3)
117
117
  })
118
118
 
119
- test('stops loading when enough chats are cached before 404', async () => {
119
+ it('stops loading when enough chats are cached before 404', async () => {
120
120
  let loadChatsCallCount = 0
121
121
 
122
122
  const { client } = createMockClient((request, events) => {
@@ -164,7 +164,7 @@ describe('listChats', () => {
164
164
  })
165
165
 
166
166
  describe('sendMessage confirmation', () => {
167
- test('returns confirmed message id when updateMessageSendSucceeded arrives', async () => {
167
+ it('returns confirmed message id when updateMessageSendSucceeded arrives', async () => {
168
168
  const tempId = 100
169
169
  const serverId = 999
170
170
  const events: any[] = []
@@ -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 { getNonInteractiveLoginMessage, promptNextLoginInput } from './auth'
4
4
 
@@ -19,37 +19,37 @@ describe('promptNextLoginInput non-interactive', () => {
19
19
  Object.defineProperty(process.stdout, 'isTTY', { value: originalStdoutTTY, writable: true, configurable: true })
20
20
  })
21
21
 
22
- test('returns null for provide_phone_number', async () => {
22
+ it('returns null for provide_phone_number', async () => {
23
23
  const result = await promptNextLoginInput({ next_action: 'provide_phone_number' }, {})
24
24
  expect(result).toBeNull()
25
25
  })
26
26
 
27
- test('returns null for provide_code', async () => {
27
+ it('returns null for provide_code', async () => {
28
28
  const result = await promptNextLoginInput({ next_action: 'provide_code' }, {})
29
29
  expect(result).toBeNull()
30
30
  })
31
31
 
32
- test('returns null for provide_password', async () => {
32
+ it('returns null for provide_password', async () => {
33
33
  const result = await promptNextLoginInput({ next_action: 'provide_password' }, {})
34
34
  expect(result).toBeNull()
35
35
  })
36
36
 
37
- test('returns null for provide_email', async () => {
37
+ it('returns null for provide_email', async () => {
38
38
  const result = await promptNextLoginInput({ next_action: 'provide_email' }, {})
39
39
  expect(result).toBeNull()
40
40
  })
41
41
 
42
- test('returns null for provide_email_code', async () => {
42
+ it('returns null for provide_email_code', async () => {
43
43
  const result = await promptNextLoginInput({ next_action: 'provide_email_code' }, {})
44
44
  expect(result).toBeNull()
45
45
  })
46
46
 
47
- test('returns null for provide_registration', async () => {
47
+ it('returns null for provide_registration', async () => {
48
48
  const result = await promptNextLoginInput({ next_action: 'provide_registration' }, {})
49
49
  expect(result).toBeNull()
50
50
  })
51
51
 
52
- test('returns options unchanged for unknown next_action', async () => {
52
+ it('returns options unchanged for unknown next_action', async () => {
53
53
  const options = { phone: '+14155551234' }
54
54
  const result = await promptNextLoginInput({ next_action: undefined }, options)
55
55
 
@@ -59,56 +59,56 @@ describe('promptNextLoginInput non-interactive', () => {
59
59
  })
60
60
 
61
61
  describe('getNonInteractiveLoginMessage', () => {
62
- test('maps provide_phone_number to provide_phone with --phone hint', () => {
62
+ it('maps provide_phone_number to provide_phone with --phone hint', () => {
63
63
  const msg = getNonInteractiveLoginMessage('provide_phone_number')
64
64
  expect(msg).not.toBeNull()
65
65
  expect(msg!.next_action).toBe('provide_phone')
66
66
  expect(msg!.message).toContain('--phone')
67
67
  })
68
68
 
69
- test('maps provide_code with --code hint', () => {
69
+ it('maps provide_code with --code hint', () => {
70
70
  const msg = getNonInteractiveLoginMessage('provide_code')
71
71
  expect(msg).not.toBeNull()
72
72
  expect(msg!.next_action).toBe('provide_code')
73
73
  expect(msg!.message).toContain('--code')
74
74
  })
75
75
 
76
- test('maps provide_password with --password hint', () => {
76
+ it('maps provide_password with --password hint', () => {
77
77
  const msg = getNonInteractiveLoginMessage('provide_password')
78
78
  expect(msg).not.toBeNull()
79
79
  expect(msg!.next_action).toBe('provide_password')
80
80
  expect(msg!.message).toContain('--password')
81
81
  })
82
82
 
83
- test('maps provide_email with --email hint', () => {
83
+ it('maps provide_email with --email hint', () => {
84
84
  const msg = getNonInteractiveLoginMessage('provide_email')
85
85
  expect(msg).not.toBeNull()
86
86
  expect(msg!.next_action).toBe('provide_email')
87
87
  expect(msg!.message).toContain('--email')
88
88
  })
89
89
 
90
- test('maps provide_email_code with --email-code hint', () => {
90
+ it('maps provide_email_code with --email-code hint', () => {
91
91
  const msg = getNonInteractiveLoginMessage('provide_email_code')
92
92
  expect(msg).not.toBeNull()
93
93
  expect(msg!.next_action).toBe('provide_email_code')
94
94
  expect(msg!.message).toContain('--email-code')
95
95
  })
96
96
 
97
- test('maps provide_registration with --first-name hint', () => {
97
+ it('maps provide_registration with --first-name hint', () => {
98
98
  const msg = getNonInteractiveLoginMessage('provide_registration')
99
99
  expect(msg).not.toBeNull()
100
100
  expect(msg!.next_action).toBe('provide_registration')
101
101
  expect(msg!.message).toContain('--first-name')
102
102
  })
103
103
 
104
- test('maps provide_provisioning_code with --provisioning-code hint', () => {
104
+ it('maps provide_provisioning_code with --provisioning-code hint', () => {
105
105
  const msg = getNonInteractiveLoginMessage('provide_provisioning_code')
106
106
  expect(msg).not.toBeNull()
107
107
  expect(msg!.next_action).toBe('provide_provisioning_code')
108
108
  expect(msg!.message).toContain('--provisioning-code')
109
109
  })
110
110
 
111
- test('returns null for unknown action', () => {
111
+ it('returns null for unknown action', () => {
112
112
  expect(getNonInteractiveLoginMessage('unknown_action')).toBeNull()
113
113
  })
114
114
  })
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, mock, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, mock, spyOn, it } from 'bun:test'
2
2
 
3
3
  const mockListChats = mock(() =>
4
4
  Promise.resolve([
@@ -55,19 +55,19 @@ describe('chat commands', () => {
55
55
  })
56
56
 
57
57
  describe('list subcommand', () => {
58
- test('calls listChats with default limit', async () => {
58
+ it('calls listChats with default limit', async () => {
59
59
  await chatCommand.parseAsync(['list'], { from: 'user' })
60
60
 
61
61
  expect(mockListChats).toHaveBeenCalledWith(20)
62
62
  })
63
63
 
64
- test('calls listChats with custom limit', async () => {
64
+ it('calls listChats with custom limit', async () => {
65
65
  await chatCommand.parseAsync(['list', '--limit', '5'], { from: 'user' })
66
66
 
67
67
  expect(mockListChats).toHaveBeenCalledWith(5)
68
68
  })
69
69
 
70
- test('outputs JSON array to console', async () => {
70
+ it('outputs JSON array to console', async () => {
71
71
  await chatCommand.parseAsync(['list'], { from: 'user' })
72
72
 
73
73
  expect(consoleSpy).toHaveBeenCalled()
@@ -79,19 +79,19 @@ describe('chat commands', () => {
79
79
  })
80
80
 
81
81
  describe('search subcommand', () => {
82
- test('calls searchChats with query and default limit', async () => {
82
+ it('calls searchChats with query and default limit', async () => {
83
83
  await chatCommand.parseAsync(['search', 'General'], { from: 'user' })
84
84
 
85
85
  expect(mockSearchChats).toHaveBeenCalledWith('General', 20)
86
86
  })
87
87
 
88
- test('calls searchChats with query and custom limit', async () => {
88
+ it('calls searchChats with query and custom limit', async () => {
89
89
  await chatCommand.parseAsync(['search', 'General', '--limit', '3'], { from: 'user' })
90
90
 
91
91
  expect(mockSearchChats).toHaveBeenCalledWith('General', 3)
92
92
  })
93
93
 
94
- test('outputs JSON array to console', async () => {
94
+ it('outputs JSON array to console', async () => {
95
95
  await chatCommand.parseAsync(['search', 'General'], { from: 'user' })
96
96
 
97
97
  expect(consoleSpy).toHaveBeenCalled()
@@ -103,13 +103,13 @@ describe('chat commands', () => {
103
103
  })
104
104
 
105
105
  describe('get subcommand', () => {
106
- test('calls getChat with chat reference', async () => {
106
+ it('calls getChat with chat reference', async () => {
107
107
  await chatCommand.parseAsync(['get', 'chat-1'], { from: 'user' })
108
108
 
109
109
  expect(mockGetChat).toHaveBeenCalledWith('chat-1')
110
110
  })
111
111
 
112
- test('outputs JSON object to console', async () => {
112
+ it('outputs JSON object to console', async () => {
113
113
  await chatCommand.parseAsync(['get', 'chat-1'], { from: 'user' })
114
114
 
115
115
  expect(consoleSpy).toHaveBeenCalled()
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, mock, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, mock, spyOn, it } from 'bun:test'
2
2
 
3
3
  const mockListMessages = mock(() =>
4
4
  Promise.resolve([
@@ -46,19 +46,19 @@ describe('message commands', () => {
46
46
  })
47
47
 
48
48
  describe('list subcommand', () => {
49
- test('calls listMessages with chat reference and default limit', async () => {
49
+ it('calls listMessages with chat reference and default limit', async () => {
50
50
  await messageCommand.parseAsync(['list', 'chat-123'], { from: 'user' })
51
51
 
52
52
  expect(mockListMessages).toHaveBeenCalledWith('chat-123', 20)
53
53
  })
54
54
 
55
- test('calls listMessages with custom limit', async () => {
55
+ it('calls listMessages with custom limit', async () => {
56
56
  await messageCommand.parseAsync(['list', 'chat-123', '--limit', '10'], { from: 'user' })
57
57
 
58
58
  expect(mockListMessages).toHaveBeenCalledWith('chat-123', 10)
59
59
  })
60
60
 
61
- test('outputs JSON to console', async () => {
61
+ it('outputs JSON to console', async () => {
62
62
  await messageCommand.parseAsync(['list', 'chat-123'], { from: 'user' })
63
63
 
64
64
  expect(consoleSpy).toHaveBeenCalled()
@@ -70,13 +70,13 @@ describe('message commands', () => {
70
70
  })
71
71
 
72
72
  describe('send subcommand', () => {
73
- test('calls sendMessage with chat reference and text', async () => {
73
+ it('calls sendMessage with chat reference and text', async () => {
74
74
  await messageCommand.parseAsync(['send', 'chat-123', 'Hello there'], { from: 'user' })
75
75
 
76
76
  expect(mockSendMessage).toHaveBeenCalledWith('chat-123', 'Hello there')
77
77
  })
78
78
 
79
- test('outputs JSON to console', async () => {
79
+ it('outputs JSON to console', async () => {
80
80
  await messageCommand.parseAsync(['send', 'chat-123', 'Hello there'], { from: 'user' })
81
81
 
82
82
  expect(consoleSpy).toHaveBeenCalled()
@@ -1,14 +1,14 @@
1
- import { describe, expect, test } from 'bun:test'
1
+ import { describe, expect, it } from 'bun:test'
2
2
 
3
3
  import { TelegramError } from '../types'
4
4
  import { parseLimitOption } from './shared'
5
5
 
6
6
  describe('telegram shared command helpers', () => {
7
- test('parseLimitOption accepts normal integer strings', () => {
7
+ it('parseLimitOption accepts normal integer strings', () => {
8
8
  expect(parseLimitOption('10', 20)).toBe(10)
9
9
  })
10
10
 
11
- test('parseLimitOption rejects malformed numeric prefixes', () => {
11
+ it('parseLimitOption rejects malformed numeric prefixes', () => {
12
12
  expect(() => parseLimitOption('10abc', 20)).toThrow(TelegramError)
13
13
  expect(() => parseLimitOption('1.5', 20)).toThrow(TelegramError)
14
14
  expect(() => parseLimitOption('2e3', 20)).toThrow(TelegramError)
@@ -1,4 +1,4 @@
1
- import { afterEach, beforeEach, describe, expect, spyOn, test } from 'bun:test'
1
+ import { afterEach, beforeEach, describe, expect, spyOn, it } from 'bun:test'
2
2
 
3
3
  import { TelegramTdlibClient } from '../client'
4
4
  import { TelegramCredentialManager } from '../credential-manager'
@@ -41,7 +41,7 @@ describe('whoami command', () => {
41
41
  consoleLogSpy?.mockRestore()
42
42
  })
43
43
 
44
- test('outputs account info with user when authenticated', async () => {
44
+ it('outputs account info with user when authenticated', async () => {
45
45
  await whoamiAction({})
46
46
 
47
47
  expect(consoleLogSpy).toHaveBeenCalledTimes(1)
@@ -54,7 +54,7 @@ describe('whoami command', () => {
54
54
  expect(output.user.username).toBe('testuser')
55
55
  })
56
56
 
57
- test('omits user field when not present', async () => {
57
+ it('omits user field when not present', async () => {
58
58
  getAuthStatusSpy.mockResolvedValue({
59
59
  account_id: 'plus-12025551234',
60
60
  phone_number: '+12025551234',