agent-messenger 1.2.0 → 1.3.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 (80) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +1 -1
  3. package/dist/package.json +3 -2
  4. package/dist/src/platforms/slackbot/cli.d.ts +5 -0
  5. package/dist/src/platforms/slackbot/cli.d.ts.map +1 -0
  6. package/dist/src/platforms/slackbot/cli.js +19 -0
  7. package/dist/src/platforms/slackbot/cli.js.map +1 -0
  8. package/dist/src/platforms/slackbot/client.d.ts +43 -0
  9. package/dist/src/platforms/slackbot/client.d.ts.map +1 -0
  10. package/dist/src/platforms/slackbot/client.js +347 -0
  11. package/dist/src/platforms/slackbot/client.js.map +1 -0
  12. package/dist/src/platforms/slackbot/commands/auth.d.ts +35 -0
  13. package/dist/src/platforms/slackbot/commands/auth.d.ts.map +1 -0
  14. package/dist/src/platforms/slackbot/commands/auth.js +185 -0
  15. package/dist/src/platforms/slackbot/commands/auth.js.map +1 -0
  16. package/dist/src/platforms/slackbot/commands/channel.d.ts +3 -0
  17. package/dist/src/platforms/slackbot/commands/channel.d.ts.map +1 -0
  18. package/dist/src/platforms/slackbot/commands/channel.js +40 -0
  19. package/dist/src/platforms/slackbot/commands/channel.js.map +1 -0
  20. package/dist/src/platforms/slackbot/commands/index.d.ts +6 -0
  21. package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -0
  22. package/dist/src/platforms/slackbot/commands/index.js +6 -0
  23. package/dist/src/platforms/slackbot/commands/index.js.map +1 -0
  24. package/dist/src/platforms/slackbot/commands/message.d.ts +3 -0
  25. package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -0
  26. package/dist/src/platforms/slackbot/commands/message.js +135 -0
  27. package/dist/src/platforms/slackbot/commands/message.js.map +1 -0
  28. package/dist/src/platforms/slackbot/commands/reaction.d.ts +3 -0
  29. package/dist/src/platforms/slackbot/commands/reaction.d.ts.map +1 -0
  30. package/dist/src/platforms/slackbot/commands/reaction.js +43 -0
  31. package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -0
  32. package/dist/src/platforms/slackbot/commands/shared.d.ts +9 -0
  33. package/dist/src/platforms/slackbot/commands/shared.d.ts.map +1 -0
  34. package/dist/src/platforms/slackbot/commands/shared.js +13 -0
  35. package/dist/src/platforms/slackbot/commands/shared.js.map +1 -0
  36. package/dist/src/platforms/slackbot/commands/user.d.ts +3 -0
  37. package/dist/src/platforms/slackbot/commands/user.d.ts.map +1 -0
  38. package/dist/src/platforms/slackbot/commands/user.js +40 -0
  39. package/dist/src/platforms/slackbot/commands/user.js.map +1 -0
  40. package/dist/src/platforms/slackbot/credential-manager.d.ts +18 -0
  41. package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -0
  42. package/dist/src/platforms/slackbot/credential-manager.js +187 -0
  43. package/dist/src/platforms/slackbot/credential-manager.js.map +1 -0
  44. package/dist/src/platforms/slackbot/index.d.ts +4 -0
  45. package/dist/src/platforms/slackbot/index.d.ts.map +1 -0
  46. package/dist/src/platforms/slackbot/index.js +4 -0
  47. package/dist/src/platforms/slackbot/index.js.map +1 -0
  48. package/dist/src/platforms/slackbot/types.d.ts +460 -0
  49. package/dist/src/platforms/slackbot/types.d.ts.map +1 -0
  50. package/dist/src/platforms/slackbot/types.js +114 -0
  51. package/dist/src/platforms/slackbot/types.js.map +1 -0
  52. package/docs/content/docs/integrations/meta.json +1 -1
  53. package/docs/content/docs/integrations/slackbot.mdx +204 -0
  54. package/docs/src/app/page.tsx +18 -1
  55. package/e2e/config.ts +26 -0
  56. package/e2e/helpers.ts +6 -1
  57. package/e2e/slackbot.e2e.test.ts +306 -0
  58. package/package.json +3 -2
  59. package/skills/agent-slackbot/SKILL.md +285 -0
  60. package/skills/agent-slackbot/references/authentication.md +253 -0
  61. package/skills/agent-slackbot/references/common-patterns.md +218 -0
  62. package/skills/agent-slackbot/templates/monitor-channel.sh +98 -0
  63. package/skills/agent-slackbot/templates/post-message.sh +107 -0
  64. package/skills/agent-slackbot/templates/workspace-summary.sh +113 -0
  65. package/src/platforms/slackbot/cli.ts +30 -0
  66. package/src/platforms/slackbot/client.test.ts +282 -0
  67. package/src/platforms/slackbot/client.ts +401 -0
  68. package/src/platforms/slackbot/commands/auth.test.ts +245 -0
  69. package/src/platforms/slackbot/commands/auth.ts +240 -0
  70. package/src/platforms/slackbot/commands/channel.ts +46 -0
  71. package/src/platforms/slackbot/commands/index.ts +5 -0
  72. package/src/platforms/slackbot/commands/message.ts +182 -0
  73. package/src/platforms/slackbot/commands/reaction.ts +59 -0
  74. package/src/platforms/slackbot/commands/shared.ts +23 -0
  75. package/src/platforms/slackbot/commands/user.ts +46 -0
  76. package/src/platforms/slackbot/credential-manager.test.ts +264 -0
  77. package/src/platforms/slackbot/credential-manager.ts +218 -0
  78. package/src/platforms/slackbot/index.ts +19 -0
  79. package/src/platforms/slackbot/types.test.ts +90 -0
  80. package/src/platforms/slackbot/types.ts +222 -0
@@ -0,0 +1,185 @@
1
+ import { Command } from 'commander';
2
+ import { formatOutput } from '../../../shared/utils/output';
3
+ import { SlackBotClient } from '../client';
4
+ import { SlackBotCredentialManager } from '../credential-manager';
5
+ export async function setAction(token, options) {
6
+ try {
7
+ if (!token.startsWith('xoxb-')) {
8
+ return { error: 'Token must be a bot token (xoxb-). User tokens (xoxp-) are not supported.' };
9
+ }
10
+ const client = new SlackBotClient(token);
11
+ const authInfo = await client.testAuth();
12
+ const botId = options.bot || authInfo.bot_id || authInfo.user || 'default';
13
+ const botName = options.name || authInfo.user || botId;
14
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
15
+ await credManager.setCredentials({
16
+ token,
17
+ workspace_id: authInfo.team_id,
18
+ workspace_name: authInfo.team || authInfo.team_id,
19
+ bot_id: botId,
20
+ bot_name: botName,
21
+ });
22
+ return {
23
+ success: true,
24
+ workspace_id: authInfo.team_id,
25
+ workspace_name: authInfo.team || authInfo.team_id,
26
+ bot_id: botId,
27
+ bot_name: botName,
28
+ user: authInfo.user,
29
+ team: authInfo.team,
30
+ };
31
+ }
32
+ catch (error) {
33
+ return { error: error.message };
34
+ }
35
+ }
36
+ export async function clearAction(options) {
37
+ try {
38
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
39
+ await credManager.clearCredentials();
40
+ return { success: true };
41
+ }
42
+ catch (error) {
43
+ return { error: error.message };
44
+ }
45
+ }
46
+ export async function statusAction(options) {
47
+ try {
48
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
49
+ const creds = await credManager.getCredentials(options.bot);
50
+ if (!creds) {
51
+ return {
52
+ valid: false,
53
+ error: options.bot
54
+ ? `Bot "${options.bot}" not found. Run "auth list" to see available bots.`
55
+ : 'No credentials configured. Run "auth set <token>" first.',
56
+ };
57
+ }
58
+ let valid = false;
59
+ let authInfo = null;
60
+ try {
61
+ const client = new SlackBotClient(creds.token);
62
+ authInfo = await client.testAuth();
63
+ valid = true;
64
+ }
65
+ catch {
66
+ valid = false;
67
+ }
68
+ return {
69
+ valid,
70
+ workspace_id: creds.workspace_id,
71
+ workspace_name: creds.workspace_name,
72
+ bot_id: creds.bot_id,
73
+ bot_name: creds.bot_name,
74
+ user: authInfo?.user,
75
+ team: authInfo?.team,
76
+ };
77
+ }
78
+ catch (error) {
79
+ return { error: error.message };
80
+ }
81
+ }
82
+ export async function listAction(options) {
83
+ try {
84
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
85
+ const all = await credManager.listAll();
86
+ return {
87
+ bots: all.map((b) => ({
88
+ workspace_id: b.workspace_id,
89
+ workspace_name: b.workspace_name,
90
+ bot_id: b.bot_id,
91
+ bot_name: b.bot_name,
92
+ is_current: b.is_current,
93
+ })),
94
+ };
95
+ }
96
+ catch (error) {
97
+ return { error: error.message };
98
+ }
99
+ }
100
+ export async function useAction(botId, options) {
101
+ try {
102
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
103
+ const found = await credManager.setCurrent(botId);
104
+ if (!found) {
105
+ return { error: `Bot "${botId}" not found. Run "auth list" to see available bots.` };
106
+ }
107
+ const creds = await credManager.getCredentials();
108
+ return {
109
+ success: true,
110
+ workspace_id: creds?.workspace_id,
111
+ workspace_name: creds?.workspace_name,
112
+ bot_id: creds?.bot_id,
113
+ bot_name: creds?.bot_name,
114
+ };
115
+ }
116
+ catch (error) {
117
+ return { error: error.message };
118
+ }
119
+ }
120
+ export async function removeAction(botId, options) {
121
+ try {
122
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
123
+ const removed = await credManager.removeBot(botId);
124
+ if (!removed) {
125
+ return { error: `Bot "${botId}" not found. Run "auth list" to see available bots.` };
126
+ }
127
+ return { success: true };
128
+ }
129
+ catch (error) {
130
+ return { error: error.message };
131
+ }
132
+ }
133
+ function cliOutput(result, pretty, exitOnError = true) {
134
+ console.log(formatOutput(result, pretty));
135
+ if (result.error && exitOnError)
136
+ process.exit(1);
137
+ }
138
+ export const authCommand = new Command('auth')
139
+ .description('Bot authentication commands')
140
+ .addCommand(new Command('set')
141
+ .description('Set bot token')
142
+ .argument('<token>', 'Bot token (xoxb-...)')
143
+ .option('--bot <id>', 'Bot identifier for switching later')
144
+ .option('--name <name>', 'Human-readable bot name')
145
+ .option('--pretty', 'Pretty print JSON output')
146
+ .action(async (token, opts) => {
147
+ cliOutput(await setAction(token, opts), opts.pretty);
148
+ }))
149
+ .addCommand(new Command('clear')
150
+ .description('Clear all stored credentials')
151
+ .option('--pretty', 'Pretty print JSON output')
152
+ .action(async (opts) => {
153
+ cliOutput(await clearAction(opts), opts.pretty);
154
+ }))
155
+ .addCommand(new Command('status')
156
+ .description('Show authentication status')
157
+ .option('--bot <id>', 'Check specific bot (default: current)')
158
+ .option('--pretty', 'Pretty print JSON output')
159
+ .action(async (opts) => {
160
+ const result = await statusAction(opts);
161
+ console.log(formatOutput(result, opts.pretty));
162
+ if (!result.valid)
163
+ process.exit(1);
164
+ }))
165
+ .addCommand(new Command('list')
166
+ .description('List all stored bots')
167
+ .option('--pretty', 'Pretty print JSON output')
168
+ .action(async (opts) => {
169
+ cliOutput(await listAction(opts), opts.pretty);
170
+ }))
171
+ .addCommand(new Command('use')
172
+ .description('Switch active bot')
173
+ .argument('<bot>', 'Bot ID or workspace_id/bot_id')
174
+ .option('--pretty', 'Pretty print JSON output')
175
+ .action(async (botId, opts) => {
176
+ cliOutput(await useAction(botId, opts), opts.pretty);
177
+ }))
178
+ .addCommand(new Command('remove')
179
+ .description('Remove a stored bot')
180
+ .argument('<bot>', 'Bot ID or workspace_id/bot_id')
181
+ .option('--pretty', 'Pretty print JSON output')
182
+ .action(async (botId, opts) => {
183
+ cliOutput(await removeAction(botId, opts), opts.pretty);
184
+ }));
185
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AA4BjE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAa,EAAE,OAAsB;IACnE,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,KAAK,EAAE,2EAA2E,EAAE,CAAA;QAC/F,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;QAExC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,IAAI,SAAS,CAAA;QAC1E,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,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AM,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AACtD,CAAC,CAAC,CACL;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,qBAAqB,CAAC;KAClC,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAC;KAClD,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,IAA0B,EAAE,EAAE;IAC1D,SAAS,CAAC,MAAM,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AACzD,CAAC,CAAC,CACL,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const channelCommand: Command;
3
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BnC,eAAO,MAAM,cAAc,SAiBxB,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { Command } from 'commander';
2
+ import { handleError } from '../../../shared/utils/error-handler';
3
+ import { formatOutput } from '../../../shared/utils/output';
4
+ import { getClient } from './shared';
5
+ async function listAction(options) {
6
+ try {
7
+ const client = await getClient(options);
8
+ const limit = options.limit ? parseInt(options.limit, 10) : undefined;
9
+ const channels = await client.listChannels(limit ? { limit } : undefined);
10
+ console.log(formatOutput(channels, options.pretty));
11
+ }
12
+ catch (error) {
13
+ handleError(error);
14
+ }
15
+ }
16
+ async function infoAction(channel, options) {
17
+ try {
18
+ const client = await getClient(options);
19
+ const info = await client.getChannelInfo(channel);
20
+ console.log(formatOutput(info, options.pretty));
21
+ }
22
+ catch (error) {
23
+ handleError(error);
24
+ }
25
+ }
26
+ export const channelCommand = new Command('channel')
27
+ .description('Channel commands')
28
+ .addCommand(new Command('list')
29
+ .description('List channels')
30
+ .option('--limit <n>', 'Number of channels to fetch')
31
+ .option('--bot <id>', 'Use specific bot')
32
+ .option('--pretty', 'Pretty print JSON output')
33
+ .action(listAction))
34
+ .addCommand(new Command('info')
35
+ .description('Get channel info')
36
+ .argument('<channel>', 'Channel ID')
37
+ .option('--bot <id>', 'Use specific bot')
38
+ .option('--pretty', 'Pretty print JSON output')
39
+ .action(infoAction));
40
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpD,KAAK,UAAU,UAAU,CAAC,OAAuC;IAC/D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACrE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QAEzE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,OAAkB;IAC3D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;QAEjD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC;KACjD,WAAW,CAAC,kBAAkB,CAAC;KAC/B,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,eAAe,CAAC;KAC5B,MAAM,CAAC,aAAa,EAAE,6BAA6B,CAAC;KACpD,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,kBAAkB,CAAC;KAC/B,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { authCommand } from './auth';
2
+ export { channelCommand } from './channel';
3
+ export { messageCommand } from './message';
4
+ export { reactionCommand } from './reaction';
5
+ export { userCommand } from './user';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA"}
@@ -0,0 +1,6 @@
1
+ export { authCommand } from './auth';
2
+ export { channelCommand } from './channel';
3
+ export { messageCommand } from './message';
4
+ export { reactionCommand } from './reaction';
5
+ export { userCommand } from './user';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const messageCommand: Command;
3
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA0HnC,eAAO,MAAM,cAAc,SA2DxB,CAAA"}
@@ -0,0 +1,135 @@
1
+ import { Command } from 'commander';
2
+ import { handleError } from '../../../shared/utils/error-handler';
3
+ import { formatOutput } from '../../../shared/utils/output';
4
+ import { getClient } from './shared';
5
+ async function sendAction(channel, text, options) {
6
+ try {
7
+ const client = await getClient(options);
8
+ const result = await client.postMessage(channel, text, {
9
+ thread_ts: options.thread,
10
+ });
11
+ console.log(formatOutput({
12
+ ts: result.ts,
13
+ channel,
14
+ text: result.text,
15
+ thread_ts: result.thread_ts,
16
+ }, options.pretty));
17
+ }
18
+ catch (error) {
19
+ handleError(error);
20
+ }
21
+ }
22
+ async function listAction(channel, options) {
23
+ try {
24
+ const client = await getClient(options);
25
+ const limit = options.limit ? parseInt(options.limit, 10) : 20;
26
+ const messages = await client.getConversationHistory(channel, { limit });
27
+ console.log(formatOutput(messages, options.pretty));
28
+ }
29
+ catch (error) {
30
+ handleError(error);
31
+ }
32
+ }
33
+ async function getAction(channel, ts, options) {
34
+ try {
35
+ const client = await getClient(options);
36
+ const message = await client.getMessage(channel, ts);
37
+ if (!message) {
38
+ console.log(formatOutput({ error: 'Message not found' }, options.pretty));
39
+ process.exit(1);
40
+ }
41
+ console.log(formatOutput(message, options.pretty));
42
+ }
43
+ catch (error) {
44
+ handleError(error);
45
+ }
46
+ }
47
+ async function updateAction(channel, ts, text, options) {
48
+ try {
49
+ const client = await getClient(options);
50
+ const message = await client.updateMessage(channel, ts, text);
51
+ console.log(formatOutput({
52
+ ts: message.ts,
53
+ text: message.text,
54
+ type: message.type,
55
+ user: message.user,
56
+ }, options.pretty));
57
+ }
58
+ catch (error) {
59
+ handleError(error);
60
+ }
61
+ }
62
+ async function deleteAction(channel, ts, options) {
63
+ try {
64
+ if (!options.force) {
65
+ console.log(formatOutput({ warning: 'Use --force to confirm deletion', ts }, options.pretty));
66
+ process.exit(1);
67
+ }
68
+ const client = await getClient(options);
69
+ await client.deleteMessage(channel, ts);
70
+ console.log(formatOutput({ deleted: ts }, options.pretty));
71
+ }
72
+ catch (error) {
73
+ handleError(error);
74
+ }
75
+ }
76
+ async function repliesAction(channel, threadTs, options) {
77
+ try {
78
+ const client = await getClient(options);
79
+ const limit = options.limit ? parseInt(options.limit, 10) : 100;
80
+ const messages = await client.getThreadReplies(channel, threadTs, { limit });
81
+ console.log(formatOutput(messages, options.pretty));
82
+ }
83
+ catch (error) {
84
+ handleError(error);
85
+ }
86
+ }
87
+ export const messageCommand = new Command('message')
88
+ .description('Message commands')
89
+ .addCommand(new Command('send')
90
+ .description('Send a message to a channel')
91
+ .argument('<channel>', 'Channel ID')
92
+ .argument('<text>', 'Message text')
93
+ .option('--thread <ts>', 'Thread timestamp for replies')
94
+ .option('--bot <id>', 'Use specific bot')
95
+ .option('--pretty', 'Pretty print JSON output')
96
+ .action(sendAction))
97
+ .addCommand(new Command('list')
98
+ .description('List messages in a channel')
99
+ .argument('<channel>', 'Channel ID')
100
+ .option('--limit <n>', 'Number of messages to fetch', '20')
101
+ .option('--bot <id>', 'Use specific bot')
102
+ .option('--pretty', 'Pretty print JSON output')
103
+ .action(listAction))
104
+ .addCommand(new Command('get')
105
+ .description('Get a single message')
106
+ .argument('<channel>', 'Channel ID')
107
+ .argument('<ts>', 'Message timestamp')
108
+ .option('--bot <id>', 'Use specific bot')
109
+ .option('--pretty', 'Pretty print JSON output')
110
+ .action(getAction))
111
+ .addCommand(new Command('update')
112
+ .description('Update a message')
113
+ .argument('<channel>', 'Channel ID')
114
+ .argument('<ts>', 'Message timestamp')
115
+ .argument('<text>', 'New message text')
116
+ .option('--bot <id>', 'Use specific bot')
117
+ .option('--pretty', 'Pretty print JSON output')
118
+ .action(updateAction))
119
+ .addCommand(new Command('delete')
120
+ .description('Delete a message')
121
+ .argument('<channel>', 'Channel ID')
122
+ .argument('<ts>', 'Message timestamp')
123
+ .option('--force', 'Skip confirmation')
124
+ .option('--bot <id>', 'Use specific bot')
125
+ .option('--pretty', 'Pretty print JSON output')
126
+ .action(deleteAction))
127
+ .addCommand(new Command('replies')
128
+ .description('Get thread replies')
129
+ .argument('<channel>', 'Channel ID')
130
+ .argument('<thread_ts>', 'Thread timestamp')
131
+ .option('--limit <n>', 'Number of replies to fetch', '100')
132
+ .option('--bot <id>', 'Use specific bot')
133
+ .option('--pretty', 'Pretty print JSON output')
134
+ .action(repliesAction));
135
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpD,KAAK,UAAU,UAAU,CACvB,OAAe,EACf,IAAY,EACZ,OAAwC;IAExC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE;YACrD,SAAS,EAAE,OAAO,CAAC,MAAM;SAC1B,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CACT,YAAY,CACV;YACE,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,OAAO;YACP,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,EACD,OAAO,CAAC,MAAM,CACf,CACF,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,OAAuC;IAChF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAA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CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,kBAAkB,CAAC;KAC/B,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;KACrC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;KACtC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,kBAAkB,CAAC;KAC/B,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;KACrC,MAAM,CAAC,SAAS,EAAE,mBAAmB,CAAC;KACtC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,SAAS,CAAC;KACnB,WAAW,CAAC,oBAAoB,CAAC;KACjC,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;KAC3C,MAAM,CAAC,aAAa,EAAE,4BAA4B,EAAE,KAAK,CAAC;KAC1D,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,aAAa,CAAC,CACzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const reactionCommand: Command;
3
+ //# sourceMappingURL=reaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqCnC,eAAO,MAAM,eAAe,SAqBzB,CAAA"}
@@ -0,0 +1,43 @@
1
+ import { Command } from 'commander';
2
+ import { handleError } from '../../../shared/utils/error-handler';
3
+ import { formatOutput } from '../../../shared/utils/output';
4
+ import { getClient } from './shared';
5
+ async function addAction(channel, timestamp, emoji, options) {
6
+ try {
7
+ const client = await getClient(options);
8
+ await client.addReaction(channel, timestamp, emoji);
9
+ console.log(formatOutput({ success: true, channel, timestamp, emoji }, options.pretty));
10
+ }
11
+ catch (error) {
12
+ handleError(error);
13
+ }
14
+ }
15
+ async function removeAction(channel, timestamp, emoji, options) {
16
+ try {
17
+ const client = await getClient(options);
18
+ await client.removeReaction(channel, timestamp, emoji);
19
+ console.log(formatOutput({ success: true, channel, timestamp, emoji }, options.pretty));
20
+ }
21
+ catch (error) {
22
+ handleError(error);
23
+ }
24
+ }
25
+ export const reactionCommand = new Command('reaction')
26
+ .description('Reaction commands')
27
+ .addCommand(new Command('add')
28
+ .description('Add a reaction to a message')
29
+ .argument('<channel>', 'Channel ID')
30
+ .argument('<timestamp>', 'Message timestamp')
31
+ .argument('<emoji>', 'Emoji name (with or without colons)')
32
+ .option('--bot <id>', 'Use specific bot')
33
+ .option('--pretty', 'Pretty print JSON output')
34
+ .action(addAction))
35
+ .addCommand(new Command('remove')
36
+ .description('Remove a reaction from a message')
37
+ .argument('<channel>', 'Channel ID')
38
+ .argument('<timestamp>', 'Message timestamp')
39
+ .argument('<emoji>', 'Emoji name (with or without colons)')
40
+ .option('--bot <id>', 'Use specific bot')
41
+ .option('--pretty', 'Pretty print JSON output')
42
+ .action(removeAction));
43
+ //# sourceMappingURL=reaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/reaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,E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ACf,WAAW,CAAC,6BAA6B,CAAC;KAC1C,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;KAC5C,QAAQ,CAAC,SAAS,EAAE,qCAAqC,CAAC;KAC1D,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,SAAS,CAAC,CACrB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,kCAAkC,CAAC;KAC/C,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;KACnC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;KAC5C,QAAQ,CAAC,SAAS,EAAE,qCAAqC,CAAC;KAC1D,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { SlackBotClient } from '../client';
2
+ import { SlackBotCredentialManager } from '../credential-manager';
3
+ export interface BotOption {
4
+ bot?: string;
5
+ pretty?: boolean;
6
+ _credManager?: SlackBotCredentialManager;
7
+ }
8
+ export declare function getClient(options: BotOption): Promise<SlackBotClient>;
9
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,yBAAyB,CAAA;CACzC;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAY3E"}
@@ -0,0 +1,13 @@
1
+ import { formatOutput } from '../../../shared/utils/output';
2
+ import { SlackBotClient } from '../client';
3
+ import { SlackBotCredentialManager } from '../credential-manager';
4
+ export async function getClient(options) {
5
+ const credManager = options._credManager ?? new SlackBotCredentialManager();
6
+ const creds = await credManager.getCredentials(options.bot);
7
+ if (!creds) {
8
+ console.log(formatOutput({ error: 'No credentials. Run "auth set <token>" first.' }, options.pretty));
9
+ process.exit(1);
10
+ }
11
+ return new SlackBotClient(creds.token);
12
+ }
13
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQjE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAkB;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,yBAAyB,EAAE,CAAA;IAC3E,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAE3D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CACT,YAAY,CAAC,EAAE,KAAK,EAAE,+CAA+C,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CACzF,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const userCommand: Command;
3
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BnC,eAAO,MAAM,WAAW,SAiBrB,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { Command } from 'commander';
2
+ import { handleError } from '../../../shared/utils/error-handler';
3
+ import { formatOutput } from '../../../shared/utils/output';
4
+ import { getClient } from './shared';
5
+ async function listAction(options) {
6
+ try {
7
+ const client = await getClient(options);
8
+ const limit = options.limit ? parseInt(options.limit, 10) : undefined;
9
+ const users = await client.listUsers(limit ? { limit } : undefined);
10
+ console.log(formatOutput(users, options.pretty));
11
+ }
12
+ catch (error) {
13
+ handleError(error);
14
+ }
15
+ }
16
+ async function infoAction(userId, options) {
17
+ try {
18
+ const client = await getClient(options);
19
+ const user = await client.getUserInfo(userId);
20
+ console.log(formatOutput(user, options.pretty));
21
+ }
22
+ catch (error) {
23
+ handleError(error);
24
+ }
25
+ }
26
+ export const userCommand = new Command('user')
27
+ .description('User commands')
28
+ .addCommand(new Command('list')
29
+ .description('List users')
30
+ .option('--limit <n>', 'Number of users to fetch')
31
+ .option('--bot <id>', 'Use specific bot')
32
+ .option('--pretty', 'Pretty print JSON output')
33
+ .action(listAction))
34
+ .addCommand(new Command('info')
35
+ .description('Get user info')
36
+ .argument('<user>', 'User ID')
37
+ .option('--bot <id>', 'Use specific bot')
38
+ .option('--pretty', 'Pretty print JSON output')
39
+ .action(infoAction));
40
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../../src/platforms/slackbot/commands/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,YAAY,EA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,CAAC,aAAa,EAAE,0BAA0B,CAAC;KACjD,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,eAAe,CAAC;KAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;KAC7B,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { SlackBotConfig, SlackBotCredentials } from './types';
2
+ export declare class SlackBotCredentialManager {
3
+ private configDir;
4
+ private credentialsPath;
5
+ constructor(configDir?: string);
6
+ load(): Promise<SlackBotConfig>;
7
+ save(config: SlackBotConfig): Promise<void>;
8
+ getCredentials(botId?: string): Promise<SlackBotCredentials | null>;
9
+ private findBot;
10
+ setCredentials(creds: SlackBotCredentials): Promise<void>;
11
+ removeBot(botId: string): Promise<boolean>;
12
+ setCurrent(botId: string): Promise<boolean>;
13
+ listAll(): Promise<Array<SlackBotCredentials & {
14
+ is_current: boolean;
15
+ }>>;
16
+ clearCredentials(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=credential-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../../../src/platforms/slackbot/credential-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAErF,qBAAa,yBAAyB;IACpC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,eAAe,CAAQ;gBAEnB,SAAS,CAAC,EAAE,MAAM;IAKxB,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC;IAS/B,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAwCzE,OAAO,CAAC,OAAO;IAoCT,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BzD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA6C1C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAc3C,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,mBAAmB,GAAG;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAsBxE,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}