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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/package.json +3 -2
- package/dist/src/platforms/slackbot/cli.d.ts +5 -0
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/cli.js +19 -0
- package/dist/src/platforms/slackbot/cli.js.map +1 -0
- package/dist/src/platforms/slackbot/client.d.ts +43 -0
- package/dist/src/platforms/slackbot/client.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/client.js +347 -0
- package/dist/src/platforms/slackbot/client.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/auth.d.ts +35 -0
- package/dist/src/platforms/slackbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/auth.js +185 -0
- package/dist/src/platforms/slackbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/channel.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/channel.js +40 -0
- package/dist/src/platforms/slackbot/commands/channel.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts +6 -0
- package/dist/src/platforms/slackbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/index.js +6 -0
- package/dist/src/platforms/slackbot/commands/index.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/message.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/message.js +135 -0
- package/dist/src/platforms/slackbot/commands/message.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/reaction.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/reaction.js +43 -0
- package/dist/src/platforms/slackbot/commands/reaction.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/slackbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/shared.js +13 -0
- package/dist/src/platforms/slackbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/slackbot/commands/user.d.ts +3 -0
- package/dist/src/platforms/slackbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/commands/user.js +40 -0
- package/dist/src/platforms/slackbot/commands/user.js.map +1 -0
- package/dist/src/platforms/slackbot/credential-manager.d.ts +18 -0
- package/dist/src/platforms/slackbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/credential-manager.js +187 -0
- package/dist/src/platforms/slackbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/slackbot/index.d.ts +4 -0
- package/dist/src/platforms/slackbot/index.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/index.js +4 -0
- package/dist/src/platforms/slackbot/index.js.map +1 -0
- package/dist/src/platforms/slackbot/types.d.ts +460 -0
- package/dist/src/platforms/slackbot/types.d.ts.map +1 -0
- package/dist/src/platforms/slackbot/types.js +114 -0
- package/dist/src/platforms/slackbot/types.js.map +1 -0
- package/docs/content/docs/integrations/meta.json +1 -1
- package/docs/content/docs/integrations/slackbot.mdx +204 -0
- package/docs/src/app/page.tsx +18 -1
- package/e2e/config.ts +26 -0
- package/e2e/helpers.ts +6 -1
- package/e2e/slackbot.e2e.test.ts +306 -0
- package/package.json +3 -2
- package/skills/agent-slackbot/SKILL.md +285 -0
- package/skills/agent-slackbot/references/authentication.md +253 -0
- package/skills/agent-slackbot/references/common-patterns.md +218 -0
- package/skills/agent-slackbot/templates/monitor-channel.sh +98 -0
- package/skills/agent-slackbot/templates/post-message.sh +107 -0
- package/skills/agent-slackbot/templates/workspace-summary.sh +113 -0
- package/src/platforms/slackbot/cli.ts +30 -0
- package/src/platforms/slackbot/client.test.ts +282 -0
- package/src/platforms/slackbot/client.ts +401 -0
- package/src/platforms/slackbot/commands/auth.test.ts +245 -0
- package/src/platforms/slackbot/commands/auth.ts +240 -0
- package/src/platforms/slackbot/commands/channel.ts +46 -0
- package/src/platforms/slackbot/commands/index.ts +5 -0
- package/src/platforms/slackbot/commands/message.ts +182 -0
- package/src/platforms/slackbot/commands/reaction.ts +59 -0
- package/src/platforms/slackbot/commands/shared.ts +23 -0
- package/src/platforms/slackbot/commands/user.ts +46 -0
- package/src/platforms/slackbot/credential-manager.test.ts +264 -0
- package/src/platforms/slackbot/credential-manager.ts +218 -0
- package/src/platforms/slackbot/index.ts +19 -0
- package/src/platforms/slackbot/types.test.ts +90 -0
- package/src/platforms/slackbot/types.ts +222 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
export class SlackBotCredentialManager {
|
|
6
|
+
configDir;
|
|
7
|
+
credentialsPath;
|
|
8
|
+
constructor(configDir) {
|
|
9
|
+
this.configDir = configDir ?? join(homedir(), '.config', 'agent-messenger');
|
|
10
|
+
this.credentialsPath = join(this.configDir, 'slackbot-credentials.json');
|
|
11
|
+
}
|
|
12
|
+
async load() {
|
|
13
|
+
if (!existsSync(this.credentialsPath)) {
|
|
14
|
+
return { current: null, workspaces: {} };
|
|
15
|
+
}
|
|
16
|
+
const content = await readFile(this.credentialsPath, 'utf-8');
|
|
17
|
+
return JSON.parse(content);
|
|
18
|
+
}
|
|
19
|
+
async save(config) {
|
|
20
|
+
await mkdir(this.configDir, { recursive: true });
|
|
21
|
+
await writeFile(this.credentialsPath, JSON.stringify(config, null, 2));
|
|
22
|
+
await chmod(this.credentialsPath, 0o600);
|
|
23
|
+
}
|
|
24
|
+
async getCredentials(botId) {
|
|
25
|
+
const config = await this.load();
|
|
26
|
+
if (botId) {
|
|
27
|
+
return this.findBot(config, botId);
|
|
28
|
+
}
|
|
29
|
+
const envToken = process.env.E2E_SLACKBOT_TOKEN;
|
|
30
|
+
const envWorkspaceId = process.env.E2E_SLACKBOT_WORKSPACE_ID;
|
|
31
|
+
const envWorkspaceName = process.env.E2E_SLACKBOT_WORKSPACE_NAME;
|
|
32
|
+
if (envToken && envWorkspaceId && envWorkspaceName) {
|
|
33
|
+
return {
|
|
34
|
+
token: envToken,
|
|
35
|
+
workspace_id: envWorkspaceId,
|
|
36
|
+
workspace_name: envWorkspaceName,
|
|
37
|
+
bot_id: 'env',
|
|
38
|
+
bot_name: 'env',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (!config.current) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const workspace = config.workspaces[config.current.workspace_id];
|
|
45
|
+
if (!workspace)
|
|
46
|
+
return null;
|
|
47
|
+
const bot = workspace.bots[config.current.bot_id];
|
|
48
|
+
if (!bot)
|
|
49
|
+
return null;
|
|
50
|
+
return {
|
|
51
|
+
token: bot.token,
|
|
52
|
+
workspace_id: workspace.workspace_id,
|
|
53
|
+
workspace_name: workspace.workspace_name,
|
|
54
|
+
bot_id: bot.bot_id,
|
|
55
|
+
bot_name: bot.bot_name,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
findBot(config, botId) {
|
|
59
|
+
// Try "workspace_id/bot_id" format first
|
|
60
|
+
if (botId.includes('/')) {
|
|
61
|
+
const [workspaceId, id] = botId.split('/');
|
|
62
|
+
const workspace = config.workspaces[workspaceId];
|
|
63
|
+
if (!workspace)
|
|
64
|
+
return null;
|
|
65
|
+
const bot = workspace.bots[id];
|
|
66
|
+
if (!bot)
|
|
67
|
+
return null;
|
|
68
|
+
return {
|
|
69
|
+
token: bot.token,
|
|
70
|
+
workspace_id: workspace.workspace_id,
|
|
71
|
+
workspace_name: workspace.workspace_name,
|
|
72
|
+
bot_id: bot.bot_id,
|
|
73
|
+
bot_name: bot.bot_name,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Search by bot_id across all workspaces — must be unique
|
|
77
|
+
const matches = [];
|
|
78
|
+
for (const workspace of Object.values(config.workspaces)) {
|
|
79
|
+
const bot = workspace.bots[botId];
|
|
80
|
+
if (bot) {
|
|
81
|
+
matches.push({
|
|
82
|
+
token: bot.token,
|
|
83
|
+
workspace_id: workspace.workspace_id,
|
|
84
|
+
workspace_name: workspace.workspace_name,
|
|
85
|
+
bot_id: bot.bot_id,
|
|
86
|
+
bot_name: bot.bot_name,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (matches.length === 1)
|
|
91
|
+
return matches[0];
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
async setCredentials(creds) {
|
|
95
|
+
const config = await this.load();
|
|
96
|
+
if (!config.workspaces[creds.workspace_id]) {
|
|
97
|
+
config.workspaces[creds.workspace_id] = {
|
|
98
|
+
workspace_id: creds.workspace_id,
|
|
99
|
+
workspace_name: creds.workspace_name,
|
|
100
|
+
bots: {},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const workspace = config.workspaces[creds.workspace_id];
|
|
104
|
+
workspace.workspace_name = creds.workspace_name;
|
|
105
|
+
workspace.bots[creds.bot_id] = {
|
|
106
|
+
bot_id: creds.bot_id,
|
|
107
|
+
bot_name: creds.bot_name,
|
|
108
|
+
token: creds.token,
|
|
109
|
+
};
|
|
110
|
+
config.current = {
|
|
111
|
+
workspace_id: creds.workspace_id,
|
|
112
|
+
bot_id: creds.bot_id,
|
|
113
|
+
};
|
|
114
|
+
await this.save(config);
|
|
115
|
+
}
|
|
116
|
+
async removeBot(botId) {
|
|
117
|
+
const config = await this.load();
|
|
118
|
+
if (botId.includes('/')) {
|
|
119
|
+
const [workspaceId, id] = botId.split('/');
|
|
120
|
+
const workspace = config.workspaces[workspaceId];
|
|
121
|
+
if (!workspace || !workspace.bots[id])
|
|
122
|
+
return false;
|
|
123
|
+
delete workspace.bots[id];
|
|
124
|
+
if (Object.keys(workspace.bots).length === 0) {
|
|
125
|
+
delete config.workspaces[workspaceId];
|
|
126
|
+
}
|
|
127
|
+
if (config.current?.workspace_id === workspaceId && config.current?.bot_id === id) {
|
|
128
|
+
config.current = null;
|
|
129
|
+
}
|
|
130
|
+
await this.save(config);
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
const matches = [];
|
|
134
|
+
for (const workspace of Object.values(config.workspaces)) {
|
|
135
|
+
if (workspace.bots[botId]) {
|
|
136
|
+
matches.push({ workspace });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (matches.length !== 1)
|
|
140
|
+
return false;
|
|
141
|
+
const { workspace } = matches[0];
|
|
142
|
+
delete workspace.bots[botId];
|
|
143
|
+
if (Object.keys(workspace.bots).length === 0) {
|
|
144
|
+
delete config.workspaces[workspace.workspace_id];
|
|
145
|
+
}
|
|
146
|
+
if (config.current?.workspace_id === workspace.workspace_id &&
|
|
147
|
+
config.current?.bot_id === botId) {
|
|
148
|
+
config.current = null;
|
|
149
|
+
}
|
|
150
|
+
await this.save(config);
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
async setCurrent(botId) {
|
|
154
|
+
const config = await this.load();
|
|
155
|
+
const creds = this.findBot(config, botId);
|
|
156
|
+
if (!creds)
|
|
157
|
+
return false;
|
|
158
|
+
config.current = {
|
|
159
|
+
workspace_id: creds.workspace_id,
|
|
160
|
+
bot_id: creds.bot_id,
|
|
161
|
+
};
|
|
162
|
+
await this.save(config);
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
async listAll() {
|
|
166
|
+
const config = await this.load();
|
|
167
|
+
const results = [];
|
|
168
|
+
for (const workspace of Object.values(config.workspaces)) {
|
|
169
|
+
for (const bot of Object.values(workspace.bots)) {
|
|
170
|
+
results.push({
|
|
171
|
+
token: bot.token,
|
|
172
|
+
workspace_id: workspace.workspace_id,
|
|
173
|
+
workspace_name: workspace.workspace_name,
|
|
174
|
+
bot_id: bot.bot_id,
|
|
175
|
+
bot_name: bot.bot_name,
|
|
176
|
+
is_current: config.current?.workspace_id === workspace.workspace_id &&
|
|
177
|
+
config.current?.bot_id === bot.bot_id,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return results;
|
|
182
|
+
}
|
|
183
|
+
async clearCredentials() {
|
|
184
|
+
await this.save({ current: null, workspaces: {} });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=credential-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../../../src/platforms/slackbot/credential-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,MAAM,OAAO,yBAAyB;IAC5B,SAAS,CAAQ;IACjB,eAAe,CAAQ;IAE/B,YAAY,SAAkB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;QAC3E,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAA;IAC1E,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;QAC1C,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;QAC7D,OAAO,IAAI,CAAC,KAA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AAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,YAAY,EAAE,SAAS,CAAC,YAAY;oBACpC,cAAc,EAAE,SAAS,CAAC,cAAc;oBACxC,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,UAAU,EACR,MAAM,CAAC,OAAO,EAAE,YAAY,KAAK,SAAS,CAAC,YAAY;wBACvD,MAAM,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM;iBACxC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAA;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SlackBotClient } from './client';
|
|
2
|
+
export { SlackBotCredentialManager } from './credential-manager';
|
|
3
|
+
export { SlackBotConfig, SlackBotConfigSchema, SlackBotCredentials, SlackBotCredentialsSchema, SlackBotError, SlackChannel, SlackChannelSchema, SlackFile, SlackFileSchema, SlackMessage, SlackMessageSchema, SlackReaction, SlackReactionSchema, SlackUser, SlackUserSchema, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platforms/slackbot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,eAAe,GAChB,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SlackBotClient } from './client';
|
|
2
|
+
export { SlackBotCredentialManager } from './credential-manager';
|
|
3
|
+
export { SlackBotConfigSchema, SlackBotCredentialsSchema, SlackBotError, SlackChannelSchema, SlackFileSchema, SlackMessageSchema, SlackReactionSchema, SlackUserSchema, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platforms/slackbot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAEL,oBAAoB,EAEpB,yBAAyB,EACzB,aAAa,EAEb,kBAAkB,EAElB,eAAe,EAEf,kBAAkB,EAElB,mBAAmB,EAEnB,eAAe,GAChB,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface SlackBotCredentials {
|
|
3
|
+
token: string;
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
workspace_name: string;
|
|
6
|
+
bot_id: string;
|
|
7
|
+
bot_name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SlackBotEntry {
|
|
10
|
+
bot_id: string;
|
|
11
|
+
bot_name: string;
|
|
12
|
+
token: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SlackBotWorkspace {
|
|
15
|
+
workspace_id: string;
|
|
16
|
+
workspace_name: string;
|
|
17
|
+
bots: Record<string, SlackBotEntry>;
|
|
18
|
+
}
|
|
19
|
+
export interface SlackBotConfig {
|
|
20
|
+
current: {
|
|
21
|
+
workspace_id: string;
|
|
22
|
+
bot_id: string;
|
|
23
|
+
} | null;
|
|
24
|
+
workspaces: Record<string, SlackBotWorkspace>;
|
|
25
|
+
}
|
|
26
|
+
export declare class SlackBotError extends Error {
|
|
27
|
+
code: string;
|
|
28
|
+
constructor(message: string, code: string);
|
|
29
|
+
}
|
|
30
|
+
export interface SlackChannel {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
is_private: boolean;
|
|
34
|
+
is_archived: boolean;
|
|
35
|
+
created: number;
|
|
36
|
+
creator: string;
|
|
37
|
+
topic?: {
|
|
38
|
+
value: string;
|
|
39
|
+
creator: string;
|
|
40
|
+
last_set: number;
|
|
41
|
+
};
|
|
42
|
+
purpose?: {
|
|
43
|
+
value: string;
|
|
44
|
+
creator: string;
|
|
45
|
+
last_set: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface SlackMessage {
|
|
49
|
+
ts: string;
|
|
50
|
+
text: string;
|
|
51
|
+
user?: string;
|
|
52
|
+
username?: string;
|
|
53
|
+
type: string;
|
|
54
|
+
thread_ts?: string;
|
|
55
|
+
reply_count?: number;
|
|
56
|
+
replies?: Array<{
|
|
57
|
+
user: string;
|
|
58
|
+
ts: string;
|
|
59
|
+
}>;
|
|
60
|
+
edited?: {
|
|
61
|
+
user: string;
|
|
62
|
+
ts: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface SlackUser {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
real_name: string;
|
|
69
|
+
is_admin: boolean;
|
|
70
|
+
is_owner: boolean;
|
|
71
|
+
is_bot: boolean;
|
|
72
|
+
is_app_user: boolean;
|
|
73
|
+
profile?: {
|
|
74
|
+
email?: string;
|
|
75
|
+
phone?: string;
|
|
76
|
+
title?: string;
|
|
77
|
+
status_text?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export interface SlackReaction {
|
|
81
|
+
name: string;
|
|
82
|
+
count: number;
|
|
83
|
+
users: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface SlackFile {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
title: string;
|
|
89
|
+
mimetype: string;
|
|
90
|
+
size: number;
|
|
91
|
+
url_private: string;
|
|
92
|
+
created: number;
|
|
93
|
+
user: string;
|
|
94
|
+
channels?: string[];
|
|
95
|
+
}
|
|
96
|
+
export declare const SlackBotEntrySchema: z.ZodObject<{
|
|
97
|
+
bot_id: z.ZodString;
|
|
98
|
+
bot_name: z.ZodString;
|
|
99
|
+
token: z.ZodString;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
token: string;
|
|
102
|
+
bot_id: string;
|
|
103
|
+
bot_name: string;
|
|
104
|
+
}, {
|
|
105
|
+
token: string;
|
|
106
|
+
bot_id: string;
|
|
107
|
+
bot_name: string;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const SlackBotWorkspaceSchema: z.ZodObject<{
|
|
110
|
+
workspace_id: z.ZodString;
|
|
111
|
+
workspace_name: z.ZodString;
|
|
112
|
+
bots: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
113
|
+
bot_id: z.ZodString;
|
|
114
|
+
bot_name: z.ZodString;
|
|
115
|
+
token: z.ZodString;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
token: string;
|
|
118
|
+
bot_id: string;
|
|
119
|
+
bot_name: string;
|
|
120
|
+
}, {
|
|
121
|
+
token: string;
|
|
122
|
+
bot_id: string;
|
|
123
|
+
bot_name: string;
|
|
124
|
+
}>>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
workspace_id: string;
|
|
127
|
+
workspace_name: string;
|
|
128
|
+
bots: Record<string, {
|
|
129
|
+
token: string;
|
|
130
|
+
bot_id: string;
|
|
131
|
+
bot_name: string;
|
|
132
|
+
}>;
|
|
133
|
+
}, {
|
|
134
|
+
workspace_id: string;
|
|
135
|
+
workspace_name: string;
|
|
136
|
+
bots: Record<string, {
|
|
137
|
+
token: string;
|
|
138
|
+
bot_id: string;
|
|
139
|
+
bot_name: string;
|
|
140
|
+
}>;
|
|
141
|
+
}>;
|
|
142
|
+
export declare const SlackBotCredentialsSchema: z.ZodObject<{
|
|
143
|
+
token: z.ZodString;
|
|
144
|
+
workspace_id: z.ZodString;
|
|
145
|
+
workspace_name: z.ZodString;
|
|
146
|
+
bot_id: z.ZodString;
|
|
147
|
+
bot_name: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
token: string;
|
|
150
|
+
workspace_id: string;
|
|
151
|
+
workspace_name: string;
|
|
152
|
+
bot_id: string;
|
|
153
|
+
bot_name: string;
|
|
154
|
+
}, {
|
|
155
|
+
token: string;
|
|
156
|
+
workspace_id: string;
|
|
157
|
+
workspace_name: string;
|
|
158
|
+
bot_id: string;
|
|
159
|
+
bot_name: string;
|
|
160
|
+
}>;
|
|
161
|
+
export declare const SlackBotConfigSchema: z.ZodObject<{
|
|
162
|
+
current: z.ZodNullable<z.ZodObject<{
|
|
163
|
+
workspace_id: z.ZodString;
|
|
164
|
+
bot_id: z.ZodString;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
workspace_id: string;
|
|
167
|
+
bot_id: string;
|
|
168
|
+
}, {
|
|
169
|
+
workspace_id: string;
|
|
170
|
+
bot_id: string;
|
|
171
|
+
}>>;
|
|
172
|
+
workspaces: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
173
|
+
workspace_id: z.ZodString;
|
|
174
|
+
workspace_name: z.ZodString;
|
|
175
|
+
bots: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
176
|
+
bot_id: z.ZodString;
|
|
177
|
+
bot_name: z.ZodString;
|
|
178
|
+
token: z.ZodString;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
token: string;
|
|
181
|
+
bot_id: string;
|
|
182
|
+
bot_name: string;
|
|
183
|
+
}, {
|
|
184
|
+
token: string;
|
|
185
|
+
bot_id: string;
|
|
186
|
+
bot_name: string;
|
|
187
|
+
}>>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
workspace_id: string;
|
|
190
|
+
workspace_name: string;
|
|
191
|
+
bots: Record<string, {
|
|
192
|
+
token: string;
|
|
193
|
+
bot_id: string;
|
|
194
|
+
bot_name: string;
|
|
195
|
+
}>;
|
|
196
|
+
}, {
|
|
197
|
+
workspace_id: string;
|
|
198
|
+
workspace_name: string;
|
|
199
|
+
bots: Record<string, {
|
|
200
|
+
token: string;
|
|
201
|
+
bot_id: string;
|
|
202
|
+
bot_name: string;
|
|
203
|
+
}>;
|
|
204
|
+
}>>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
current: {
|
|
207
|
+
workspace_id: string;
|
|
208
|
+
bot_id: string;
|
|
209
|
+
} | null;
|
|
210
|
+
workspaces: Record<string, {
|
|
211
|
+
workspace_id: string;
|
|
212
|
+
workspace_name: string;
|
|
213
|
+
bots: Record<string, {
|
|
214
|
+
token: string;
|
|
215
|
+
bot_id: string;
|
|
216
|
+
bot_name: string;
|
|
217
|
+
}>;
|
|
218
|
+
}>;
|
|
219
|
+
}, {
|
|
220
|
+
current: {
|
|
221
|
+
workspace_id: string;
|
|
222
|
+
bot_id: string;
|
|
223
|
+
} | null;
|
|
224
|
+
workspaces: Record<string, {
|
|
225
|
+
workspace_id: string;
|
|
226
|
+
workspace_name: string;
|
|
227
|
+
bots: Record<string, {
|
|
228
|
+
token: string;
|
|
229
|
+
bot_id: string;
|
|
230
|
+
bot_name: string;
|
|
231
|
+
}>;
|
|
232
|
+
}>;
|
|
233
|
+
}>;
|
|
234
|
+
export declare const SlackChannelSchema: z.ZodObject<{
|
|
235
|
+
id: z.ZodString;
|
|
236
|
+
name: z.ZodString;
|
|
237
|
+
is_private: z.ZodBoolean;
|
|
238
|
+
is_archived: z.ZodBoolean;
|
|
239
|
+
created: z.ZodNumber;
|
|
240
|
+
creator: z.ZodString;
|
|
241
|
+
topic: z.ZodOptional<z.ZodObject<{
|
|
242
|
+
value: z.ZodString;
|
|
243
|
+
creator: z.ZodString;
|
|
244
|
+
last_set: z.ZodNumber;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
value: string;
|
|
247
|
+
creator: string;
|
|
248
|
+
last_set: number;
|
|
249
|
+
}, {
|
|
250
|
+
value: string;
|
|
251
|
+
creator: string;
|
|
252
|
+
last_set: number;
|
|
253
|
+
}>>;
|
|
254
|
+
purpose: z.ZodOptional<z.ZodObject<{
|
|
255
|
+
value: z.ZodString;
|
|
256
|
+
creator: z.ZodString;
|
|
257
|
+
last_set: z.ZodNumber;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
value: string;
|
|
260
|
+
creator: string;
|
|
261
|
+
last_set: number;
|
|
262
|
+
}, {
|
|
263
|
+
value: string;
|
|
264
|
+
creator: string;
|
|
265
|
+
last_set: number;
|
|
266
|
+
}>>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
is_private: boolean;
|
|
271
|
+
is_archived: boolean;
|
|
272
|
+
created: number;
|
|
273
|
+
creator: string;
|
|
274
|
+
topic?: {
|
|
275
|
+
value: string;
|
|
276
|
+
creator: string;
|
|
277
|
+
last_set: number;
|
|
278
|
+
} | undefined;
|
|
279
|
+
purpose?: {
|
|
280
|
+
value: string;
|
|
281
|
+
creator: string;
|
|
282
|
+
last_set: number;
|
|
283
|
+
} | undefined;
|
|
284
|
+
}, {
|
|
285
|
+
id: string;
|
|
286
|
+
name: string;
|
|
287
|
+
is_private: boolean;
|
|
288
|
+
is_archived: boolean;
|
|
289
|
+
created: number;
|
|
290
|
+
creator: string;
|
|
291
|
+
topic?: {
|
|
292
|
+
value: string;
|
|
293
|
+
creator: string;
|
|
294
|
+
last_set: number;
|
|
295
|
+
} | undefined;
|
|
296
|
+
purpose?: {
|
|
297
|
+
value: string;
|
|
298
|
+
creator: string;
|
|
299
|
+
last_set: number;
|
|
300
|
+
} | undefined;
|
|
301
|
+
}>;
|
|
302
|
+
export declare const SlackMessageSchema: z.ZodObject<{
|
|
303
|
+
ts: z.ZodString;
|
|
304
|
+
text: z.ZodString;
|
|
305
|
+
user: z.ZodOptional<z.ZodString>;
|
|
306
|
+
username: z.ZodOptional<z.ZodString>;
|
|
307
|
+
type: z.ZodString;
|
|
308
|
+
thread_ts: z.ZodOptional<z.ZodString>;
|
|
309
|
+
reply_count: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
replies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
311
|
+
user: z.ZodString;
|
|
312
|
+
ts: z.ZodString;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
user: string;
|
|
315
|
+
ts: string;
|
|
316
|
+
}, {
|
|
317
|
+
user: string;
|
|
318
|
+
ts: string;
|
|
319
|
+
}>, "many">>;
|
|
320
|
+
edited: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
user: z.ZodString;
|
|
322
|
+
ts: z.ZodString;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
user: string;
|
|
325
|
+
ts: string;
|
|
326
|
+
}, {
|
|
327
|
+
user: string;
|
|
328
|
+
ts: string;
|
|
329
|
+
}>>;
|
|
330
|
+
}, "strip", z.ZodTypeAny, {
|
|
331
|
+
type: string;
|
|
332
|
+
ts: string;
|
|
333
|
+
text: string;
|
|
334
|
+
username?: string | undefined;
|
|
335
|
+
user?: string | undefined;
|
|
336
|
+
thread_ts?: string | undefined;
|
|
337
|
+
reply_count?: number | undefined;
|
|
338
|
+
replies?: {
|
|
339
|
+
user: string;
|
|
340
|
+
ts: string;
|
|
341
|
+
}[] | undefined;
|
|
342
|
+
edited?: {
|
|
343
|
+
user: string;
|
|
344
|
+
ts: string;
|
|
345
|
+
} | undefined;
|
|
346
|
+
}, {
|
|
347
|
+
type: string;
|
|
348
|
+
ts: string;
|
|
349
|
+
text: string;
|
|
350
|
+
username?: string | undefined;
|
|
351
|
+
user?: string | undefined;
|
|
352
|
+
thread_ts?: string | undefined;
|
|
353
|
+
reply_count?: number | undefined;
|
|
354
|
+
replies?: {
|
|
355
|
+
user: string;
|
|
356
|
+
ts: string;
|
|
357
|
+
}[] | undefined;
|
|
358
|
+
edited?: {
|
|
359
|
+
user: string;
|
|
360
|
+
ts: string;
|
|
361
|
+
} | undefined;
|
|
362
|
+
}>;
|
|
363
|
+
export declare const SlackUserSchema: z.ZodObject<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
name: z.ZodString;
|
|
366
|
+
real_name: z.ZodString;
|
|
367
|
+
is_admin: z.ZodBoolean;
|
|
368
|
+
is_owner: z.ZodBoolean;
|
|
369
|
+
is_bot: z.ZodBoolean;
|
|
370
|
+
is_app_user: z.ZodBoolean;
|
|
371
|
+
profile: z.ZodOptional<z.ZodObject<{
|
|
372
|
+
email: z.ZodOptional<z.ZodString>;
|
|
373
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
374
|
+
title: z.ZodOptional<z.ZodString>;
|
|
375
|
+
status_text: z.ZodOptional<z.ZodString>;
|
|
376
|
+
}, "strip", z.ZodTypeAny, {
|
|
377
|
+
email?: string | undefined;
|
|
378
|
+
phone?: string | undefined;
|
|
379
|
+
title?: string | undefined;
|
|
380
|
+
status_text?: string | undefined;
|
|
381
|
+
}, {
|
|
382
|
+
email?: string | undefined;
|
|
383
|
+
phone?: string | undefined;
|
|
384
|
+
title?: string | undefined;
|
|
385
|
+
status_text?: string | undefined;
|
|
386
|
+
}>>;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
id: string;
|
|
389
|
+
name: string;
|
|
390
|
+
real_name: string;
|
|
391
|
+
is_admin: boolean;
|
|
392
|
+
is_owner: boolean;
|
|
393
|
+
is_bot: boolean;
|
|
394
|
+
is_app_user: boolean;
|
|
395
|
+
profile?: {
|
|
396
|
+
email?: string | undefined;
|
|
397
|
+
phone?: string | undefined;
|
|
398
|
+
title?: string | undefined;
|
|
399
|
+
status_text?: string | undefined;
|
|
400
|
+
} | undefined;
|
|
401
|
+
}, {
|
|
402
|
+
id: string;
|
|
403
|
+
name: string;
|
|
404
|
+
real_name: string;
|
|
405
|
+
is_admin: boolean;
|
|
406
|
+
is_owner: boolean;
|
|
407
|
+
is_bot: boolean;
|
|
408
|
+
is_app_user: boolean;
|
|
409
|
+
profile?: {
|
|
410
|
+
email?: string | undefined;
|
|
411
|
+
phone?: string | undefined;
|
|
412
|
+
title?: string | undefined;
|
|
413
|
+
status_text?: string | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
}>;
|
|
416
|
+
export declare const SlackReactionSchema: z.ZodObject<{
|
|
417
|
+
name: z.ZodString;
|
|
418
|
+
count: z.ZodNumber;
|
|
419
|
+
users: z.ZodArray<z.ZodString, "many">;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
name: string;
|
|
422
|
+
count: number;
|
|
423
|
+
users: string[];
|
|
424
|
+
}, {
|
|
425
|
+
name: string;
|
|
426
|
+
count: number;
|
|
427
|
+
users: string[];
|
|
428
|
+
}>;
|
|
429
|
+
export declare const SlackFileSchema: z.ZodObject<{
|
|
430
|
+
id: z.ZodString;
|
|
431
|
+
name: z.ZodString;
|
|
432
|
+
title: z.ZodString;
|
|
433
|
+
mimetype: z.ZodString;
|
|
434
|
+
size: z.ZodNumber;
|
|
435
|
+
url_private: z.ZodString;
|
|
436
|
+
created: z.ZodNumber;
|
|
437
|
+
user: z.ZodString;
|
|
438
|
+
channels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
id: string;
|
|
441
|
+
name: string;
|
|
442
|
+
size: number;
|
|
443
|
+
user: string;
|
|
444
|
+
created: number;
|
|
445
|
+
title: string;
|
|
446
|
+
mimetype: string;
|
|
447
|
+
url_private: string;
|
|
448
|
+
channels?: string[] | undefined;
|
|
449
|
+
}, {
|
|
450
|
+
id: string;
|
|
451
|
+
name: string;
|
|
452
|
+
size: number;
|
|
453
|
+
user: string;
|
|
454
|
+
created: number;
|
|
455
|
+
title: string;
|
|
456
|
+
mimetype: string;
|
|
457
|
+
url_private: string;
|
|
458
|
+
channels?: string[] | undefined;
|
|
459
|
+
}>;
|
|
460
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/platforms/slackbot/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACxD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;CAC9C;AAGD,qBAAa,aAAc,SAAQ,KAAK;IACtC,IAAI,EAAE,MAAM,CAAA;gBAEA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAK1C;AAGD,MAAM,WAAW,YAAY;IAC3B,EAAE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