agent-messenger 1.0.0

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 (394) hide show
  1. package/.claude/commands/release.md +92 -0
  2. package/.claude-plugin/README.md +144 -0
  3. package/.claude-plugin/marketplace.json +37 -0
  4. package/.claude-plugin/plugin.json +17 -0
  5. package/.github/workflows/ci.yml +30 -0
  6. package/CLAUDE.md +106 -0
  7. package/CONTRIBUTING.md +131 -0
  8. package/README.md +140 -0
  9. package/biome.json +34 -0
  10. package/bun.lock +252 -0
  11. package/dist/cli.d.ts +5 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +21 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/commands/auth.d.ts +3 -0
  16. package/dist/commands/auth.d.ts.map +1 -0
  17. package/dist/commands/auth.js +140 -0
  18. package/dist/commands/auth.js.map +1 -0
  19. package/dist/commands/channel.d.ts +3 -0
  20. package/dist/commands/channel.d.ts.map +1 -0
  21. package/dist/commands/channel.js +118 -0
  22. package/dist/commands/channel.js.map +1 -0
  23. package/dist/commands/file.d.ts +3 -0
  24. package/dist/commands/file.d.ts.map +1 -0
  25. package/dist/commands/file.js +113 -0
  26. package/dist/commands/file.js.map +1 -0
  27. package/dist/commands/index.d.ts +9 -0
  28. package/dist/commands/index.d.ts.map +1 -0
  29. package/dist/commands/index.js +9 -0
  30. package/dist/commands/index.js.map +1 -0
  31. package/dist/commands/message.d.ts +3 -0
  32. package/dist/commands/message.d.ts.map +1 -0
  33. package/dist/commands/message.js +214 -0
  34. package/dist/commands/message.js.map +1 -0
  35. package/dist/commands/reaction.d.ts +3 -0
  36. package/dist/commands/reaction.d.ts.map +1 -0
  37. package/dist/commands/reaction.js +100 -0
  38. package/dist/commands/reaction.js.map +1 -0
  39. package/dist/commands/snapshot.d.ts +3 -0
  40. package/dist/commands/snapshot.d.ts.map +1 -0
  41. package/dist/commands/snapshot.js +88 -0
  42. package/dist/commands/snapshot.js.map +1 -0
  43. package/dist/commands/user.d.ts +3 -0
  44. package/dist/commands/user.d.ts.map +1 -0
  45. package/dist/commands/user.js +96 -0
  46. package/dist/commands/user.js.map +1 -0
  47. package/dist/commands/workspace.d.ts +3 -0
  48. package/dist/commands/workspace.d.ts.map +1 -0
  49. package/dist/commands/workspace.js +89 -0
  50. package/dist/commands/workspace.js.map +1 -0
  51. package/dist/lib/credential-manager.d.ts +13 -0
  52. package/dist/lib/credential-manager.d.ts.map +1 -0
  53. package/dist/lib/credential-manager.js +58 -0
  54. package/dist/lib/credential-manager.js.map +1 -0
  55. package/dist/lib/index.d.ts +3 -0
  56. package/dist/lib/index.d.ts.map +1 -0
  57. package/dist/lib/index.js +3 -0
  58. package/dist/lib/index.js.map +1 -0
  59. package/dist/lib/ref-manager.d.ts +26 -0
  60. package/dist/lib/ref-manager.d.ts.map +1 -0
  61. package/dist/lib/ref-manager.js +92 -0
  62. package/dist/lib/ref-manager.js.map +1 -0
  63. package/dist/lib/slack-client.d.ts +37 -0
  64. package/dist/lib/slack-client.d.ts.map +1 -0
  65. package/dist/lib/slack-client.js +379 -0
  66. package/dist/lib/slack-client.js.map +1 -0
  67. package/dist/lib/token-extractor.d.ts +28 -0
  68. package/dist/lib/token-extractor.d.ts.map +1 -0
  69. package/dist/lib/token-extractor.js +401 -0
  70. package/dist/lib/token-extractor.js.map +1 -0
  71. package/dist/package.json +37 -0
  72. package/dist/src/cli.d.ts +5 -0
  73. package/dist/src/cli.d.ts.map +1 -0
  74. package/dist/src/cli.js +22 -0
  75. package/dist/src/cli.js.map +1 -0
  76. package/dist/src/platforms/discord/cli.d.ts +5 -0
  77. package/dist/src/platforms/discord/cli.d.ts.map +1 -0
  78. package/dist/src/platforms/discord/cli.js +22 -0
  79. package/dist/src/platforms/discord/cli.js.map +1 -0
  80. package/dist/src/platforms/discord/client.d.ts +34 -0
  81. package/dist/src/platforms/discord/client.d.ts.map +1 -0
  82. package/dist/src/platforms/discord/client.js +187 -0
  83. package/dist/src/platforms/discord/client.js.map +1 -0
  84. package/dist/src/platforms/discord/client.test.d.ts +2 -0
  85. package/dist/src/platforms/discord/client.test.d.ts.map +1 -0
  86. package/dist/src/platforms/discord/client.test.js +367 -0
  87. package/dist/src/platforms/discord/client.test.js.map +1 -0
  88. package/dist/src/platforms/discord/commands/auth.d.ts +13 -0
  89. package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -0
  90. package/dist/src/platforms/discord/commands/auth.js +155 -0
  91. package/dist/src/platforms/discord/commands/auth.js.map +1 -0
  92. package/dist/src/platforms/discord/commands/auth.test.d.ts +2 -0
  93. package/dist/src/platforms/discord/commands/auth.test.d.ts.map +1 -0
  94. package/dist/src/platforms/discord/commands/auth.test.js +65 -0
  95. package/dist/src/platforms/discord/commands/auth.test.js.map +1 -0
  96. package/dist/src/platforms/discord/commands/channel.d.ts +13 -0
  97. package/dist/src/platforms/discord/commands/channel.d.ts.map +1 -0
  98. package/dist/src/platforms/discord/commands/channel.js +99 -0
  99. package/dist/src/platforms/discord/commands/channel.js.map +1 -0
  100. package/dist/src/platforms/discord/commands/channel.test.d.ts +2 -0
  101. package/dist/src/platforms/discord/commands/channel.test.d.ts.map +1 -0
  102. package/dist/src/platforms/discord/commands/channel.test.js +136 -0
  103. package/dist/src/platforms/discord/commands/channel.test.js.map +1 -0
  104. package/dist/src/platforms/discord/commands/file.d.ts +13 -0
  105. package/dist/src/platforms/discord/commands/file.d.ts.map +1 -0
  106. package/dist/src/platforms/discord/commands/file.js +99 -0
  107. package/dist/src/platforms/discord/commands/file.js.map +1 -0
  108. package/dist/src/platforms/discord/commands/file.test.d.ts +2 -0
  109. package/dist/src/platforms/discord/commands/file.test.d.ts.map +1 -0
  110. package/dist/src/platforms/discord/commands/file.test.js +83 -0
  111. package/dist/src/platforms/discord/commands/file.test.js.map +1 -0
  112. package/dist/src/platforms/discord/commands/guild.d.ts +15 -0
  113. package/dist/src/platforms/discord/commands/guild.d.ts.map +1 -0
  114. package/dist/src/platforms/discord/commands/guild.js +102 -0
  115. package/dist/src/platforms/discord/commands/guild.js.map +1 -0
  116. package/dist/src/platforms/discord/commands/guild.test.d.ts +2 -0
  117. package/dist/src/platforms/discord/commands/guild.test.d.ts.map +1 -0
  118. package/dist/src/platforms/discord/commands/guild.test.js +100 -0
  119. package/dist/src/platforms/discord/commands/guild.test.js.map +1 -0
  120. package/dist/src/platforms/discord/commands/index.d.ts +9 -0
  121. package/dist/src/platforms/discord/commands/index.d.ts.map +1 -0
  122. package/dist/src/platforms/discord/commands/index.js +9 -0
  123. package/dist/src/platforms/discord/commands/index.js.map +1 -0
  124. package/dist/src/platforms/discord/commands/message.d.ts +17 -0
  125. package/dist/src/platforms/discord/commands/message.d.ts.map +1 -0
  126. package/dist/src/platforms/discord/commands/message.js +131 -0
  127. package/dist/src/platforms/discord/commands/message.js.map +1 -0
  128. package/dist/src/platforms/discord/commands/message.test.d.ts +2 -0
  129. package/dist/src/platforms/discord/commands/message.test.d.ts.map +1 -0
  130. package/dist/src/platforms/discord/commands/message.test.js +91 -0
  131. package/dist/src/platforms/discord/commands/message.test.js.map +1 -0
  132. package/dist/src/platforms/discord/commands/reaction.d.ts +12 -0
  133. package/dist/src/platforms/discord/commands/reaction.d.ts.map +1 -0
  134. package/dist/src/platforms/discord/commands/reaction.js +99 -0
  135. package/dist/src/platforms/discord/commands/reaction.js.map +1 -0
  136. package/dist/src/platforms/discord/commands/reaction.test.d.ts +2 -0
  137. package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +1 -0
  138. package/dist/src/platforms/discord/commands/reaction.test.js +115 -0
  139. package/dist/src/platforms/discord/commands/reaction.test.js.map +1 -0
  140. package/dist/src/platforms/discord/commands/snapshot.d.ts +9 -0
  141. package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -0
  142. package/dist/src/platforms/discord/commands/snapshot.js +80 -0
  143. package/dist/src/platforms/discord/commands/snapshot.js.map +1 -0
  144. package/dist/src/platforms/discord/commands/snapshot.test.d.ts +2 -0
  145. package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +1 -0
  146. package/dist/src/platforms/discord/commands/snapshot.test.js +25 -0
  147. package/dist/src/platforms/discord/commands/snapshot.test.js.map +1 -0
  148. package/dist/src/platforms/discord/commands/user.d.ts +3 -0
  149. package/dist/src/platforms/discord/commands/user.d.ts.map +1 -0
  150. package/dist/src/platforms/discord/commands/user.js +94 -0
  151. package/dist/src/platforms/discord/commands/user.js.map +1 -0
  152. package/dist/src/platforms/discord/commands/user.test.d.ts +2 -0
  153. package/dist/src/platforms/discord/commands/user.test.d.ts.map +1 -0
  154. package/dist/src/platforms/discord/commands/user.test.js +103 -0
  155. package/dist/src/platforms/discord/commands/user.test.js.map +1 -0
  156. package/dist/src/platforms/discord/credential-manager.d.ts +33 -0
  157. package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -0
  158. package/dist/src/platforms/discord/credential-manager.js +73 -0
  159. package/dist/src/platforms/discord/credential-manager.js.map +1 -0
  160. package/dist/src/platforms/discord/credential-manager.test.d.ts +2 -0
  161. package/dist/src/platforms/discord/credential-manager.test.d.ts.map +1 -0
  162. package/dist/src/platforms/discord/credential-manager.test.js +136 -0
  163. package/dist/src/platforms/discord/credential-manager.test.js.map +1 -0
  164. package/dist/src/platforms/discord/token-extractor.d.ts +55 -0
  165. package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -0
  166. package/dist/src/platforms/discord/token-extractor.js +462 -0
  167. package/dist/src/platforms/discord/token-extractor.js.map +1 -0
  168. package/dist/src/platforms/discord/token-extractor.test.d.ts +2 -0
  169. package/dist/src/platforms/discord/token-extractor.test.d.ts.map +1 -0
  170. package/dist/src/platforms/discord/token-extractor.test.js +789 -0
  171. package/dist/src/platforms/discord/token-extractor.test.js.map +1 -0
  172. package/dist/src/platforms/discord/types.d.ts +251 -0
  173. package/dist/src/platforms/discord/types.d.ts.map +1 -0
  174. package/dist/src/platforms/discord/types.js +74 -0
  175. package/dist/src/platforms/discord/types.js.map +1 -0
  176. package/dist/src/platforms/discord/types.test.d.ts +2 -0
  177. package/dist/src/platforms/discord/types.test.d.ts.map +1 -0
  178. package/dist/src/platforms/discord/types.test.js +211 -0
  179. package/dist/src/platforms/discord/types.test.js.map +1 -0
  180. package/dist/src/platforms/slack/cli.d.ts +5 -0
  181. package/dist/src/platforms/slack/cli.d.ts.map +1 -0
  182. package/dist/src/platforms/slack/cli.js +22 -0
  183. package/dist/src/platforms/slack/cli.js.map +1 -0
  184. package/dist/src/platforms/slack/client.d.ts +47 -0
  185. package/dist/src/platforms/slack/client.d.ts.map +1 -0
  186. package/dist/src/platforms/slack/client.js +412 -0
  187. package/dist/src/platforms/slack/client.js.map +1 -0
  188. package/dist/src/platforms/slack/commands/auth.d.ts +3 -0
  189. package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -0
  190. package/dist/src/platforms/slack/commands/auth.js +156 -0
  191. package/dist/src/platforms/slack/commands/auth.js.map +1 -0
  192. package/dist/src/platforms/slack/commands/channel.d.ts +3 -0
  193. package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -0
  194. package/dist/src/platforms/slack/commands/channel.js +118 -0
  195. package/dist/src/platforms/slack/commands/channel.js.map +1 -0
  196. package/dist/src/platforms/slack/commands/file.d.ts +3 -0
  197. package/dist/src/platforms/slack/commands/file.d.ts.map +1 -0
  198. package/dist/src/platforms/slack/commands/file.js +113 -0
  199. package/dist/src/platforms/slack/commands/file.js.map +1 -0
  200. package/dist/src/platforms/slack/commands/index.d.ts +9 -0
  201. package/dist/src/platforms/slack/commands/index.d.ts.map +1 -0
  202. package/dist/src/platforms/slack/commands/index.js +9 -0
  203. package/dist/src/platforms/slack/commands/index.js.map +1 -0
  204. package/dist/src/platforms/slack/commands/message.d.ts +3 -0
  205. package/dist/src/platforms/slack/commands/message.d.ts.map +1 -0
  206. package/dist/src/platforms/slack/commands/message.js +263 -0
  207. package/dist/src/platforms/slack/commands/message.js.map +1 -0
  208. package/dist/src/platforms/slack/commands/reaction.d.ts +3 -0
  209. package/dist/src/platforms/slack/commands/reaction.d.ts.map +1 -0
  210. package/dist/src/platforms/slack/commands/reaction.js +100 -0
  211. package/dist/src/platforms/slack/commands/reaction.js.map +1 -0
  212. package/dist/src/platforms/slack/commands/snapshot.d.ts +3 -0
  213. package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -0
  214. package/dist/src/platforms/slack/commands/snapshot.js +87 -0
  215. package/dist/src/platforms/slack/commands/snapshot.js.map +1 -0
  216. package/dist/src/platforms/slack/commands/user.d.ts +3 -0
  217. package/dist/src/platforms/slack/commands/user.d.ts.map +1 -0
  218. package/dist/src/platforms/slack/commands/user.js +96 -0
  219. package/dist/src/platforms/slack/commands/user.js.map +1 -0
  220. package/dist/src/platforms/slack/commands/workspace.d.ts +3 -0
  221. package/dist/src/platforms/slack/commands/workspace.d.ts.map +1 -0
  222. package/dist/src/platforms/slack/commands/workspace.js +89 -0
  223. package/dist/src/platforms/slack/commands/workspace.js.map +1 -0
  224. package/dist/src/platforms/slack/credential-manager.d.ts +13 -0
  225. package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -0
  226. package/dist/src/platforms/slack/credential-manager.js +58 -0
  227. package/dist/src/platforms/slack/credential-manager.js.map +1 -0
  228. package/dist/src/platforms/slack/index.d.ts +3 -0
  229. package/dist/src/platforms/slack/index.d.ts.map +1 -0
  230. package/dist/src/platforms/slack/index.js +3 -0
  231. package/dist/src/platforms/slack/index.js.map +1 -0
  232. package/dist/src/platforms/slack/token-extractor.d.ts +28 -0
  233. package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -0
  234. package/dist/src/platforms/slack/token-extractor.js +401 -0
  235. package/dist/src/platforms/slack/token-extractor.js.map +1 -0
  236. package/dist/src/platforms/slack/types.d.ts +369 -0
  237. package/dist/src/platforms/slack/types.d.ts.map +1 -0
  238. package/dist/src/platforms/slack/types.js +92 -0
  239. package/dist/src/platforms/slack/types.js.map +1 -0
  240. package/dist/src/shared/utils/concurrency.d.ts +2 -0
  241. package/dist/src/shared/utils/concurrency.d.ts.map +1 -0
  242. package/dist/src/shared/utils/concurrency.js +14 -0
  243. package/dist/src/shared/utils/concurrency.js.map +1 -0
  244. package/dist/src/shared/utils/concurrency.test.d.ts +2 -0
  245. package/dist/src/shared/utils/concurrency.test.d.ts.map +1 -0
  246. package/dist/src/shared/utils/concurrency.test.js +39 -0
  247. package/dist/src/shared/utils/concurrency.test.js.map +1 -0
  248. package/dist/src/shared/utils/error-handler.d.ts +2 -0
  249. package/dist/src/shared/utils/error-handler.d.ts.map +1 -0
  250. package/dist/src/shared/utils/error-handler.js +5 -0
  251. package/dist/src/shared/utils/error-handler.js.map +1 -0
  252. package/dist/src/shared/utils/output.d.ts +2 -0
  253. package/dist/src/shared/utils/output.d.ts.map +1 -0
  254. package/dist/src/shared/utils/output.js +4 -0
  255. package/dist/src/shared/utils/output.js.map +1 -0
  256. package/dist/tests/cli.test.d.ts +2 -0
  257. package/dist/tests/cli.test.d.ts.map +1 -0
  258. package/dist/tests/cli.test.js +83 -0
  259. package/dist/tests/cli.test.js.map +1 -0
  260. package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +1 -0
  261. package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
  262. package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +3 -0
  263. package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +1 -0
  264. package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
  265. package/dist/tests/commands/auth.test.d.ts +2 -0
  266. package/dist/tests/commands/auth.test.d.ts.map +1 -0
  267. package/dist/tests/commands/auth.test.js +304 -0
  268. package/dist/tests/commands/auth.test.js.map +1 -0
  269. package/dist/tests/commands/channel.test.d.ts +2 -0
  270. package/dist/tests/commands/channel.test.d.ts.map +1 -0
  271. package/dist/tests/commands/channel.test.js +166 -0
  272. package/dist/tests/commands/channel.test.js.map +1 -0
  273. package/dist/tests/commands/file.test.d.ts +2 -0
  274. package/dist/tests/commands/file.test.d.ts.map +1 -0
  275. package/dist/tests/commands/file.test.js +175 -0
  276. package/dist/tests/commands/file.test.js.map +1 -0
  277. package/dist/tests/commands/message.test.d.ts +2 -0
  278. package/dist/tests/commands/message.test.d.ts.map +1 -0
  279. package/dist/tests/commands/message.test.js +293 -0
  280. package/dist/tests/commands/message.test.js.map +1 -0
  281. package/dist/tests/commands/reaction.test.d.ts +2 -0
  282. package/dist/tests/commands/reaction.test.d.ts.map +1 -0
  283. package/dist/tests/commands/reaction.test.js +84 -0
  284. package/dist/tests/commands/reaction.test.js.map +1 -0
  285. package/dist/tests/commands/snapshot.test.d.ts +2 -0
  286. package/dist/tests/commands/snapshot.test.d.ts.map +1 -0
  287. package/dist/tests/commands/snapshot.test.js +280 -0
  288. package/dist/tests/commands/snapshot.test.js.map +1 -0
  289. package/dist/tests/commands/user.test.d.ts +2 -0
  290. package/dist/tests/commands/user.test.d.ts.map +1 -0
  291. package/dist/tests/commands/user.test.js +117 -0
  292. package/dist/tests/commands/user.test.js.map +1 -0
  293. package/dist/tests/commands/workspace.test.d.ts +2 -0
  294. package/dist/tests/commands/workspace.test.d.ts.map +1 -0
  295. package/dist/tests/commands/workspace.test.js +453 -0
  296. package/dist/tests/commands/workspace.test.js.map +1 -0
  297. package/dist/tests/credential-manager.test.d.ts +2 -0
  298. package/dist/tests/credential-manager.test.d.ts.map +1 -0
  299. package/dist/tests/credential-manager.test.js +199 -0
  300. package/dist/tests/credential-manager.test.js.map +1 -0
  301. package/dist/tests/slack-client.test.d.ts +2 -0
  302. package/dist/tests/slack-client.test.d.ts.map +1 -0
  303. package/dist/tests/slack-client.test.js +741 -0
  304. package/dist/tests/slack-client.test.js.map +1 -0
  305. package/dist/tests/types.test.d.ts +2 -0
  306. package/dist/tests/types.test.d.ts.map +1 -0
  307. package/dist/tests/types.test.js +215 -0
  308. package/dist/tests/types.test.js.map +1 -0
  309. package/dist/types/index.d.ts +369 -0
  310. package/dist/types/index.d.ts.map +1 -0
  311. package/dist/types/index.js +92 -0
  312. package/dist/types/index.js.map +1 -0
  313. package/dist/utils/error-handler.d.ts +2 -0
  314. package/dist/utils/error-handler.d.ts.map +1 -0
  315. package/dist/utils/error-handler.js +5 -0
  316. package/dist/utils/error-handler.js.map +1 -0
  317. package/dist/utils/output.d.ts +2 -0
  318. package/dist/utils/output.d.ts.map +1 -0
  319. package/dist/utils/output.js +4 -0
  320. package/dist/utils/output.js.map +1 -0
  321. package/docs/discord.md +182 -0
  322. package/docs/slack.md +160 -0
  323. package/package.json +37 -0
  324. package/skills/agent-discord/SKILL.md +273 -0
  325. package/skills/agent-discord/references/authentication.md +294 -0
  326. package/skills/agent-discord/references/common-patterns.md +455 -0
  327. package/skills/agent-discord/templates/guild-summary.sh +167 -0
  328. package/skills/agent-discord/templates/monitor-channel.sh +180 -0
  329. package/skills/agent-discord/templates/post-message.sh +173 -0
  330. package/skills/agent-slack/SKILL.md +268 -0
  331. package/skills/agent-slack/references/authentication.md +332 -0
  332. package/skills/agent-slack/references/common-patterns.md +527 -0
  333. package/skills/agent-slack/templates/monitor-channel.sh +186 -0
  334. package/skills/agent-slack/templates/post-message.sh +130 -0
  335. package/skills/agent-slack/templates/workspace-summary.sh +149 -0
  336. package/src/cli.ts +29 -0
  337. package/src/platforms/discord/cli.ts +36 -0
  338. package/src/platforms/discord/client.test.ts +456 -0
  339. package/src/platforms/discord/client.ts +281 -0
  340. package/src/platforms/discord/commands/auth.test.ts +72 -0
  341. package/src/platforms/discord/commands/auth.ts +206 -0
  342. package/src/platforms/discord/commands/channel.test.ts +153 -0
  343. package/src/platforms/discord/commands/channel.ts +127 -0
  344. package/src/platforms/discord/commands/file.test.ts +98 -0
  345. package/src/platforms/discord/commands/file.ts +134 -0
  346. package/src/platforms/discord/commands/guild.test.ts +117 -0
  347. package/src/platforms/discord/commands/guild.ts +129 -0
  348. package/src/platforms/discord/commands/index.ts +8 -0
  349. package/src/platforms/discord/commands/message.test.ts +107 -0
  350. package/src/platforms/discord/commands/message.ts +182 -0
  351. package/src/platforms/discord/commands/reaction.test.ts +123 -0
  352. package/src/platforms/discord/commands/reaction.ts +156 -0
  353. package/src/platforms/discord/commands/snapshot.test.ts +29 -0
  354. package/src/platforms/discord/commands/snapshot.ts +104 -0
  355. package/src/platforms/discord/commands/user.test.ts +115 -0
  356. package/src/platforms/discord/commands/user.ts +124 -0
  357. package/src/platforms/discord/credential-manager.test.ts +173 -0
  358. package/src/platforms/discord/credential-manager.ts +95 -0
  359. package/src/platforms/discord/token-extractor.test.ts +918 -0
  360. package/src/platforms/discord/token-extractor.ts +549 -0
  361. package/src/platforms/discord/types.test.ts +245 -0
  362. package/src/platforms/discord/types.ts +158 -0
  363. package/src/platforms/slack/cli.ts +36 -0
  364. package/src/platforms/slack/client.ts +466 -0
  365. package/src/platforms/slack/commands/auth.ts +211 -0
  366. package/src/platforms/slack/commands/channel.ts +158 -0
  367. package/src/platforms/slack/commands/file.ts +153 -0
  368. package/src/platforms/slack/commands/index.ts +8 -0
  369. package/src/platforms/slack/commands/message.ts +369 -0
  370. package/src/platforms/slack/commands/reaction.ts +166 -0
  371. package/src/platforms/slack/commands/snapshot.ts +114 -0
  372. package/src/platforms/slack/commands/user.ts +110 -0
  373. package/src/platforms/slack/commands/workspace.ts +111 -0
  374. package/src/platforms/slack/credential-manager.ts +74 -0
  375. package/src/platforms/slack/index.ts +2 -0
  376. package/src/platforms/slack/token-extractor.ts +496 -0
  377. package/src/platforms/slack/types.ts +193 -0
  378. package/src/shared/utils/concurrency.test.ts +53 -0
  379. package/src/shared/utils/concurrency.ts +20 -0
  380. package/src/shared/utils/error-handler.ts +4 -0
  381. package/src/shared/utils/output.ts +3 -0
  382. package/tests/cli.test.ts +94 -0
  383. package/tests/commands/auth.test.ts +383 -0
  384. package/tests/commands/channel.test.ts +185 -0
  385. package/tests/commands/file.test.ts +204 -0
  386. package/tests/commands/message.test.ts +344 -0
  387. package/tests/commands/reaction.test.ts +101 -0
  388. package/tests/commands/snapshot.test.ts +308 -0
  389. package/tests/commands/user.test.ts +138 -0
  390. package/tests/commands/workspace.test.ts +528 -0
  391. package/tests/credential-manager.test.ts +241 -0
  392. package/tests/slack-client.test.ts +916 -0
  393. package/tests/types.test.ts +241 -0
  394. package/tsconfig.json +36 -0
@@ -0,0 +1,369 @@
1
+ /**
2
+ * Core type definitions for agent-slack
3
+ */
4
+ import { z } from 'zod';
5
+ export interface SlackChannel {
6
+ id: string;
7
+ name: string;
8
+ is_private: boolean;
9
+ is_archived: boolean;
10
+ created: number;
11
+ creator: string;
12
+ topic?: {
13
+ value: string;
14
+ creator: string;
15
+ last_set: number;
16
+ };
17
+ purpose?: {
18
+ value: string;
19
+ creator: string;
20
+ last_set: number;
21
+ };
22
+ }
23
+ export interface SlackMessage {
24
+ ts: string;
25
+ text: string;
26
+ user?: string;
27
+ username?: string;
28
+ type: string;
29
+ thread_ts?: string;
30
+ reply_count?: number;
31
+ replies?: Array<{
32
+ user: string;
33
+ ts: string;
34
+ }>;
35
+ edited?: {
36
+ user: string;
37
+ ts: string;
38
+ };
39
+ }
40
+ export interface SlackUser {
41
+ id: string;
42
+ name: string;
43
+ real_name: string;
44
+ is_admin: boolean;
45
+ is_owner: boolean;
46
+ is_bot: boolean;
47
+ is_app_user: boolean;
48
+ profile?: {
49
+ email?: string;
50
+ phone?: string;
51
+ title?: string;
52
+ status_text?: string;
53
+ };
54
+ }
55
+ export interface SlackReaction {
56
+ name: string;
57
+ count: number;
58
+ users: string[];
59
+ }
60
+ export interface SlackFile {
61
+ id: string;
62
+ name: string;
63
+ title: string;
64
+ mimetype: string;
65
+ size: number;
66
+ url_private: string;
67
+ created: number;
68
+ user: string;
69
+ channels?: string[];
70
+ }
71
+ export interface SlackSearchResult {
72
+ ts: string;
73
+ text: string;
74
+ user?: string;
75
+ username?: string;
76
+ channel: {
77
+ id: string;
78
+ name: string;
79
+ };
80
+ permalink: string;
81
+ }
82
+ export interface WorkspaceCredentials {
83
+ workspace_id: string;
84
+ workspace_name: string;
85
+ token: string;
86
+ cookie: string;
87
+ }
88
+ export interface Config {
89
+ current_workspace: string | null;
90
+ workspaces: Record<string, WorkspaceCredentials>;
91
+ }
92
+ export declare const SlackChannelSchema: z.ZodObject<{
93
+ id: z.ZodString;
94
+ name: z.ZodString;
95
+ is_private: z.ZodBoolean;
96
+ is_archived: z.ZodBoolean;
97
+ created: z.ZodNumber;
98
+ creator: z.ZodString;
99
+ topic: z.ZodOptional<z.ZodObject<{
100
+ value: z.ZodString;
101
+ creator: z.ZodString;
102
+ last_set: z.ZodNumber;
103
+ }, "strip", z.ZodTypeAny, {
104
+ value: string;
105
+ creator: string;
106
+ last_set: number;
107
+ }, {
108
+ value: string;
109
+ creator: string;
110
+ last_set: number;
111
+ }>>;
112
+ purpose: z.ZodOptional<z.ZodObject<{
113
+ value: z.ZodString;
114
+ creator: z.ZodString;
115
+ last_set: z.ZodNumber;
116
+ }, "strip", z.ZodTypeAny, {
117
+ value: string;
118
+ creator: string;
119
+ last_set: number;
120
+ }, {
121
+ value: string;
122
+ creator: string;
123
+ last_set: number;
124
+ }>>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ id: string;
127
+ name: string;
128
+ is_private: boolean;
129
+ is_archived: boolean;
130
+ created: number;
131
+ creator: string;
132
+ topic?: {
133
+ value: string;
134
+ creator: string;
135
+ last_set: number;
136
+ } | undefined;
137
+ purpose?: {
138
+ value: string;
139
+ creator: string;
140
+ last_set: number;
141
+ } | undefined;
142
+ }, {
143
+ id: string;
144
+ name: string;
145
+ is_private: boolean;
146
+ is_archived: boolean;
147
+ created: number;
148
+ creator: string;
149
+ topic?: {
150
+ value: string;
151
+ creator: string;
152
+ last_set: number;
153
+ } | undefined;
154
+ purpose?: {
155
+ value: string;
156
+ creator: string;
157
+ last_set: number;
158
+ } | undefined;
159
+ }>;
160
+ export declare const SlackMessageSchema: z.ZodObject<{
161
+ ts: z.ZodString;
162
+ text: z.ZodString;
163
+ user: z.ZodOptional<z.ZodString>;
164
+ username: z.ZodOptional<z.ZodString>;
165
+ type: z.ZodString;
166
+ thread_ts: z.ZodOptional<z.ZodString>;
167
+ reply_count: z.ZodOptional<z.ZodNumber>;
168
+ replies: z.ZodOptional<z.ZodArray<z.ZodObject<{
169
+ user: z.ZodString;
170
+ ts: z.ZodString;
171
+ }, "strip", z.ZodTypeAny, {
172
+ user: string;
173
+ ts: string;
174
+ }, {
175
+ user: string;
176
+ ts: string;
177
+ }>, "many">>;
178
+ edited: z.ZodOptional<z.ZodObject<{
179
+ user: z.ZodString;
180
+ ts: z.ZodString;
181
+ }, "strip", z.ZodTypeAny, {
182
+ user: string;
183
+ ts: string;
184
+ }, {
185
+ user: string;
186
+ ts: string;
187
+ }>>;
188
+ }, "strip", z.ZodTypeAny, {
189
+ type: string;
190
+ ts: string;
191
+ text: string;
192
+ username?: string | undefined;
193
+ user?: string | undefined;
194
+ thread_ts?: string | undefined;
195
+ reply_count?: number | undefined;
196
+ replies?: {
197
+ user: string;
198
+ ts: string;
199
+ }[] | undefined;
200
+ edited?: {
201
+ user: string;
202
+ ts: string;
203
+ } | undefined;
204
+ }, {
205
+ type: string;
206
+ ts: string;
207
+ text: string;
208
+ username?: string | undefined;
209
+ user?: string | undefined;
210
+ thread_ts?: string | undefined;
211
+ reply_count?: number | undefined;
212
+ replies?: {
213
+ user: string;
214
+ ts: string;
215
+ }[] | undefined;
216
+ edited?: {
217
+ user: string;
218
+ ts: string;
219
+ } | undefined;
220
+ }>;
221
+ export declare const SlackUserSchema: z.ZodObject<{
222
+ id: z.ZodString;
223
+ name: z.ZodString;
224
+ real_name: z.ZodString;
225
+ is_admin: z.ZodBoolean;
226
+ is_owner: z.ZodBoolean;
227
+ is_bot: z.ZodBoolean;
228
+ is_app_user: z.ZodBoolean;
229
+ profile: z.ZodOptional<z.ZodObject<{
230
+ email: z.ZodOptional<z.ZodString>;
231
+ phone: z.ZodOptional<z.ZodString>;
232
+ title: z.ZodOptional<z.ZodString>;
233
+ status_text: z.ZodOptional<z.ZodString>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ email?: string | undefined;
236
+ phone?: string | undefined;
237
+ title?: string | undefined;
238
+ status_text?: string | undefined;
239
+ }, {
240
+ email?: string | undefined;
241
+ phone?: string | undefined;
242
+ title?: string | undefined;
243
+ status_text?: string | undefined;
244
+ }>>;
245
+ }, "strip", z.ZodTypeAny, {
246
+ id: string;
247
+ name: string;
248
+ real_name: string;
249
+ is_admin: boolean;
250
+ is_owner: boolean;
251
+ is_bot: boolean;
252
+ is_app_user: boolean;
253
+ profile?: {
254
+ email?: string | undefined;
255
+ phone?: string | undefined;
256
+ title?: string | undefined;
257
+ status_text?: string | undefined;
258
+ } | undefined;
259
+ }, {
260
+ id: string;
261
+ name: string;
262
+ real_name: string;
263
+ is_admin: boolean;
264
+ is_owner: boolean;
265
+ is_bot: boolean;
266
+ is_app_user: boolean;
267
+ profile?: {
268
+ email?: string | undefined;
269
+ phone?: string | undefined;
270
+ title?: string | undefined;
271
+ status_text?: string | undefined;
272
+ } | undefined;
273
+ }>;
274
+ export declare const SlackReactionSchema: z.ZodObject<{
275
+ name: z.ZodString;
276
+ count: z.ZodNumber;
277
+ users: z.ZodArray<z.ZodString, "many">;
278
+ }, "strip", z.ZodTypeAny, {
279
+ name: string;
280
+ count: number;
281
+ users: string[];
282
+ }, {
283
+ name: string;
284
+ count: number;
285
+ users: string[];
286
+ }>;
287
+ export declare const SlackFileSchema: z.ZodObject<{
288
+ id: z.ZodString;
289
+ name: z.ZodString;
290
+ title: z.ZodString;
291
+ mimetype: z.ZodString;
292
+ size: z.ZodNumber;
293
+ url_private: z.ZodString;
294
+ created: z.ZodNumber;
295
+ user: z.ZodString;
296
+ channels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ id: string;
299
+ name: string;
300
+ size: number;
301
+ user: string;
302
+ created: number;
303
+ title: string;
304
+ mimetype: string;
305
+ url_private: string;
306
+ channels?: string[] | undefined;
307
+ }, {
308
+ id: string;
309
+ name: string;
310
+ size: number;
311
+ user: string;
312
+ created: number;
313
+ title: string;
314
+ mimetype: string;
315
+ url_private: string;
316
+ channels?: string[] | undefined;
317
+ }>;
318
+ export declare const WorkspaceCredentialsSchema: z.ZodObject<{
319
+ workspace_id: z.ZodString;
320
+ workspace_name: z.ZodString;
321
+ token: z.ZodString;
322
+ cookie: z.ZodString;
323
+ }, "strip", z.ZodTypeAny, {
324
+ token: string;
325
+ workspace_id: string;
326
+ workspace_name: string;
327
+ cookie: string;
328
+ }, {
329
+ token: string;
330
+ workspace_id: string;
331
+ workspace_name: string;
332
+ cookie: string;
333
+ }>;
334
+ export declare const ConfigSchema: z.ZodObject<{
335
+ current_workspace: z.ZodNullable<z.ZodString>;
336
+ workspaces: z.ZodRecord<z.ZodString, z.ZodObject<{
337
+ workspace_id: z.ZodString;
338
+ workspace_name: z.ZodString;
339
+ token: z.ZodString;
340
+ cookie: z.ZodString;
341
+ }, "strip", z.ZodTypeAny, {
342
+ token: string;
343
+ workspace_id: string;
344
+ workspace_name: string;
345
+ cookie: string;
346
+ }, {
347
+ token: string;
348
+ workspace_id: string;
349
+ workspace_name: string;
350
+ cookie: string;
351
+ }>>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ current_workspace: string | null;
354
+ workspaces: Record<string, {
355
+ token: string;
356
+ workspace_id: string;
357
+ workspace_name: string;
358
+ cookie: string;
359
+ }>;
360
+ }, {
361
+ current_workspace: string | null;
362
+ workspaces: Record<string, {
363
+ token: string;
364
+ workspace_id: string;
365
+ workspace_name: string;
366
+ cookie: string;
367
+ }>;
368
+ }>;
369
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/platforms/slack/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsB7B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB1B,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU1B,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAKrC,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAA"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Core type definitions for agent-slack
3
+ */
4
+ import { z } from 'zod';
5
+ // Zod validation schemas
6
+ export const SlackChannelSchema = z.object({
7
+ id: z.string(),
8
+ name: z.string(),
9
+ is_private: z.boolean(),
10
+ is_archived: z.boolean(),
11
+ created: z.number(),
12
+ creator: z.string(),
13
+ topic: z
14
+ .object({
15
+ value: z.string(),
16
+ creator: z.string(),
17
+ last_set: z.number(),
18
+ })
19
+ .optional(),
20
+ purpose: z
21
+ .object({
22
+ value: z.string(),
23
+ creator: z.string(),
24
+ last_set: z.number(),
25
+ })
26
+ .optional(),
27
+ });
28
+ export const SlackMessageSchema = z.object({
29
+ ts: z.string(),
30
+ text: z.string(),
31
+ user: z.string().optional(),
32
+ username: z.string().optional(),
33
+ type: z.string(),
34
+ thread_ts: z.string().optional(),
35
+ reply_count: z.number().optional(),
36
+ replies: z
37
+ .array(z.object({
38
+ user: z.string(),
39
+ ts: z.string(),
40
+ }))
41
+ .optional(),
42
+ edited: z
43
+ .object({
44
+ user: z.string(),
45
+ ts: z.string(),
46
+ })
47
+ .optional(),
48
+ });
49
+ export const SlackUserSchema = z.object({
50
+ id: z.string(),
51
+ name: z.string(),
52
+ real_name: z.string(),
53
+ is_admin: z.boolean(),
54
+ is_owner: z.boolean(),
55
+ is_bot: z.boolean(),
56
+ is_app_user: z.boolean(),
57
+ profile: z
58
+ .object({
59
+ email: z.string().optional(),
60
+ phone: z.string().optional(),
61
+ title: z.string().optional(),
62
+ status_text: z.string().optional(),
63
+ })
64
+ .optional(),
65
+ });
66
+ export const SlackReactionSchema = z.object({
67
+ name: z.string(),
68
+ count: z.number(),
69
+ users: z.array(z.string()),
70
+ });
71
+ export const SlackFileSchema = z.object({
72
+ id: z.string(),
73
+ name: z.string(),
74
+ title: z.string(),
75
+ mimetype: z.string(),
76
+ size: z.number(),
77
+ url_private: z.string(),
78
+ created: z.number(),
79
+ user: z.string(),
80
+ channels: z.array(z.string()).optional(),
81
+ });
82
+ export const WorkspaceCredentialsSchema = z.object({
83
+ workspace_id: z.string(),
84
+ workspace_name: z.string(),
85
+ token: z.string(),
86
+ cookie: z.string(),
87
+ });
88
+ export const ConfigSchema = z.object({
89
+ current_workspace: z.string().nullable(),
90
+ workspaces: z.record(z.string(), WorkspaceCredentialsSchema),
91
+ });
92
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/platforms/slack/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA8FvB,yBAAyB;AACzB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,CAAC,CA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C,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,0BAA0B,CAAC;CAC7D,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function parallelMap<T, R>(items: T[], fn: (item: T, index: number) => Promise<R>, concurrency?: number): Promise<R[]>;
2
+ //# sourceMappingURL=concurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concurrency.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/concurrency.ts"],"names":[],"mappings":"AAAA,wBAAsB,WAAW,CAAC,CAAC,EAAE,CAAC,EACpC,KAAK,EAAE,CAAC,EAAE,EACV,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EAC1C,WAAW,SAAI,GACd,OAAO,CAAC,CAAC,EAAE,CAAC,CAed"}
@@ -0,0 +1,14 @@
1
+ export async function parallelMap(items, fn, concurrency = 5) {
2
+ const results = new Array(items.length);
3
+ let currentIndex = 0;
4
+ async function worker() {
5
+ while (currentIndex < items.length) {
6
+ const index = currentIndex++;
7
+ results[index] = await fn(items[index], index);
8
+ }
9
+ }
10
+ const workers = Array.from({ length: Math.min(concurrency, items.length) }, () => worker());
11
+ await Promise.all(workers);
12
+ return results;
13
+ }
14
+ //# sourceMappingURL=concurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concurrency.js","sourceRoot":"","sources":["../../../../src/shared/utils/concurrency.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAU,EACV,EAA0C,EAC1C,WAAW,GAAG,CAAC;IAEf,MAAM,OAAO,GAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5C,IAAI,YAAY,GAAG,CAAC,CAAA;IAEpB,KAAK,UAAU,MAAM;QACnB,OAAO,YAAY,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YACnC,MAAM,KAAK,GAAG,YAAY,EAAE,CAAA;YAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3F,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAE1B,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=concurrency.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concurrency.test.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/concurrency.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+ import { parallelMap } from './concurrency';
3
+ describe('parallelMap', () => {
4
+ test('processes items in parallel', async () => {
5
+ const items = [1, 2, 3, 4, 5];
6
+ const results = await parallelMap(items, async (n) => n * 2);
7
+ expect(results).toEqual([2, 4, 6, 8, 10]);
8
+ });
9
+ test('maintains order of results', async () => {
10
+ const items = [100, 50, 10];
11
+ const results = await parallelMap(items, async (delay) => {
12
+ await new Promise((r) => setTimeout(r, delay));
13
+ return delay;
14
+ }, 3);
15
+ expect(results).toEqual([100, 50, 10]);
16
+ });
17
+ test('respects concurrency limit', async () => {
18
+ let concurrent = 0;
19
+ let maxConcurrent = 0;
20
+ const items = [1, 2, 3, 4, 5, 6];
21
+ await parallelMap(items, async () => {
22
+ concurrent++;
23
+ maxConcurrent = Math.max(maxConcurrent, concurrent);
24
+ await new Promise((r) => setTimeout(r, 10));
25
+ concurrent--;
26
+ }, 2);
27
+ expect(maxConcurrent).toBe(2);
28
+ });
29
+ test('handles empty array', async () => {
30
+ const results = await parallelMap([], async (n) => n * 2);
31
+ expect(results).toEqual([]);
32
+ });
33
+ test('passes index to function', async () => {
34
+ const items = ['a', 'b', 'c'];
35
+ const results = await parallelMap(items, async (item, index) => `${item}${index}`);
36
+ expect(results).toEqual(['a0', 'b1', 'c2']);
37
+ });
38
+ });
39
+ //# sourceMappingURL=concurrency.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concurrency.test.js","sourceRoot":"","sources":["../../../../src/shared/utils/concurrency.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QAC7B,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA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C,IAAI,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACjE,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;QAC7B,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC,CAAA;QAClF,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function handleError(error: Error): void;
2
+ //# sourceMappingURL=error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/error-handler.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAG9C"}
@@ -0,0 +1,5 @@
1
+ export function handleError(error) {
2
+ console.error(JSON.stringify({ error: error.message }));
3
+ process.exit(1);
4
+ }
5
+ //# sourceMappingURL=error-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../../src/shared/utils/error-handler.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function formatOutput(data: unknown, pretty?: boolean): string;
2
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/output.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAEpE"}
@@ -0,0 +1,4 @@
1
+ export function formatOutput(data, pretty) {
2
+ return pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
3
+ }
4
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/shared/utils/output.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,MAAgB;IAC1D,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACtE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../tests/cli.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,83 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+ import { spawn } from 'bun';
3
+ import pkg from '../package.json';
4
+ import { handleError } from '../src/shared/utils/error-handler';
5
+ import { formatOutput } from '../src/shared/utils/output';
6
+ describe('CLI Framework', () => {
7
+ describe('formatOutput utility', () => {
8
+ test('formats JSON without pretty flag', () => {
9
+ const data = { message: 'hello', count: 42 };
10
+ const result = formatOutput(data, false);
11
+ expect(result).toBe('{"message":"hello","count":42}');
12
+ });
13
+ test('formats JSON with pretty flag', () => {
14
+ const data = { message: 'hello', count: 42 };
15
+ const result = formatOutput(data, true);
16
+ const expected = JSON.stringify(data, null, 2);
17
+ expect(result).toBe(expected);
18
+ });
19
+ test('handles arrays', () => {
20
+ const data = [1, 2, 3];
21
+ const result = formatOutput(data, false);
22
+ expect(result).toBe('[1,2,3]');
23
+ });
24
+ test('handles nested objects with pretty flag', () => {
25
+ const data = { user: { name: 'Alice', id: 1 } };
26
+ const result = formatOutput(data, true);
27
+ expect(result).toContain('"user"');
28
+ expect(result).toContain('"name"');
29
+ });
30
+ });
31
+ describe('handleError utility', () => {
32
+ test('logs error as JSON and exits', () => {
33
+ const originalExit = process.exit;
34
+ const originalError = console.error;
35
+ let capturedOutput = '';
36
+ console.error = (msg) => {
37
+ capturedOutput = msg;
38
+ };
39
+ process.exit = (() => {
40
+ throw new Error('EXIT_CALLED');
41
+ });
42
+ try {
43
+ handleError(new Error('Test error'));
44
+ }
45
+ catch (e) {
46
+ if (e instanceof Error && e.message === 'EXIT_CALLED') {
47
+ expect(capturedOutput).toContain('Test error');
48
+ expect(capturedOutput).toContain('error');
49
+ }
50
+ }
51
+ console.error = originalError;
52
+ process.exit = originalExit;
53
+ });
54
+ });
55
+ describe('Slack CLI program structure', () => {
56
+ test('--help shows all commands and global options', async () => {
57
+ const proc = spawn(['bun', 'run', './src/platforms/slack/cli.ts', '--help'], {
58
+ cwd: process.cwd(),
59
+ stdio: ['pipe', 'pipe', 'pipe'],
60
+ });
61
+ const output = await new Response(proc.stdout).text();
62
+ expect(output).toContain('auth');
63
+ expect(output).toContain('workspace');
64
+ expect(output).toContain('message');
65
+ expect(output).toContain('channel');
66
+ expect(output).toContain('user');
67
+ expect(output).toContain('reaction');
68
+ expect(output).toContain('file');
69
+ expect(output).toContain('snapshot');
70
+ expect(output).toContain('--pretty');
71
+ expect(output).toContain('--workspace');
72
+ });
73
+ test('--version shows package version', async () => {
74
+ const proc = spawn(['bun', 'run', './src/platforms/slack/cli.ts', '--version'], {
75
+ cwd: process.cwd(),
76
+ stdio: ['pipe', 'pipe', 'pipe'],
77
+ });
78
+ const output = await new Response(proc.stdout).text();
79
+ expect(output.trim()).toBe(pkg.version);
80
+ });
81
+ });
82
+ });
83
+ //# sourceMappingURL=cli.test.js.map