@matimo/slack 0.1.0-alpha.4 → 0.1.0-alpha.5
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/{tools/README.md → README.md} +126 -32
- package/package.json +3 -3
|
@@ -1,53 +1,147 @@
|
|
|
1
|
-
# Slack Tools
|
|
1
|
+
# @matimo/slack - Slack Tools for Matimo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Slack workspace integration tools for Matimo's universal AI tools ecosystem. Send messages, manage channels, upload files, and interact with Slack through YAML-defined tools that work with any AI framework.
|
|
4
4
|
|
|
5
|
-
## 📦
|
|
5
|
+
## 📦 Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @matimo/slack
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @matimo/slack
|
|
11
|
+
```
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
## 🛠️ Available Tools (19 Total)
|
|
14
|
+
|
|
15
|
+
| Category | Tools | Description |
|
|
16
|
+
|----------|-------|-------------|
|
|
17
|
+
| **Messaging** | 4 tools | Send messages, replies, DMs |
|
|
18
|
+
| **Channels** | 4 tools | Create, join, manage channels |
|
|
19
|
+
| **Files** | 3 tools | Upload and share files |
|
|
20
|
+
| **Reading** | 3 tools | Read messages and history |
|
|
21
|
+
| **Reactions** | 2 tools | Add/get emoji reactions |
|
|
22
|
+
| **Users** | 2 tools | Get user information |
|
|
23
|
+
|
|
24
|
+
### Complete Tool List
|
|
25
|
+
|
|
26
|
+
- **slack-send-message** - Post message to channel
|
|
27
|
+
- **slack_send_channel_message** - Post message with markdown/blocks
|
|
28
|
+
- **slack_reply_to_message** - Reply in thread
|
|
29
|
+
- **slack_send_dm** - Send direct message
|
|
30
|
+
- **slack-list-channels** - List all channels/DMs
|
|
31
|
+
- **slack_create_channel** - Create public/private channel
|
|
32
|
+
- **slack_join_channel** - Add bot to channel
|
|
33
|
+
- **slack_set_channel_topic** - Update channel description
|
|
34
|
+
- **slack_upload_file** - Upload file to Slack (modern API)
|
|
35
|
+
- **slack_upload_file_v2** - Get upload URL for files
|
|
36
|
+
- **slack_complete_file_upload** - Complete upload and share
|
|
37
|
+
- **slack_get_channel_history** - Get messages from channel
|
|
38
|
+
- **slack_get_thread_replies** - Get thread replies
|
|
39
|
+
- **slack_search_messages** - Search message history
|
|
40
|
+
- **slack_add_reaction** - Add emoji reaction
|
|
41
|
+
- **slack_get_reactions** - Get reactions on message
|
|
42
|
+
- **slack_get_user_info** - Get user details
|
|
43
|
+
- **slack-get-user** - Alias of slack_get_user_info
|
|
13
44
|
|
|
14
|
-
|
|
45
|
+
## 🚀 Quick Start
|
|
15
46
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **slack_join_channel** - Add bot to channel (conversations.join)
|
|
19
|
-
- **slack_set_channel_topic** - Update channel description (conversations.setTopic)
|
|
47
|
+
```typescript
|
|
48
|
+
import { MatimoInstance } from 'matimo';
|
|
20
49
|
|
|
21
|
-
|
|
50
|
+
const matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
22
51
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
52
|
+
// Send a message to a channel
|
|
53
|
+
await matimo.execute('slack-send-message', {
|
|
54
|
+
channel: '#general',
|
|
55
|
+
text: 'Hello from Matimo AI!'
|
|
56
|
+
});
|
|
26
57
|
|
|
27
|
-
|
|
58
|
+
// List available channels
|
|
59
|
+
const channels = await matimo.execute('slack-list-channels', {});
|
|
60
|
+
```
|
|
28
61
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
## 🔐 Authentication
|
|
63
|
+
|
|
64
|
+
Set your Slack Bot token:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
export SLACK_BOT_TOKEN="xoxb-your-bot-token"
|
|
68
|
+
```
|
|
32
69
|
|
|
33
|
-
|
|
70
|
+
Or use environment variables in your application.
|
|
34
71
|
|
|
35
|
-
|
|
36
|
-
- **slack_get_reactions** - Get reactions on message (reactions.get)
|
|
72
|
+
## 📚 Integration Examples
|
|
37
73
|
|
|
38
|
-
###
|
|
74
|
+
### With LangChain
|
|
39
75
|
|
|
40
|
-
|
|
41
|
-
|
|
76
|
+
```typescript
|
|
77
|
+
import { MatimoInstance } from 'matimo';
|
|
78
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
79
|
+
|
|
80
|
+
const matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
81
|
+
const tools = matimo.listTools().filter(t => t.name.startsWith('slack'));
|
|
82
|
+
|
|
83
|
+
// Use with LangChain agent
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### With Custom Code
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { MatimoInstance } from 'matimo';
|
|
90
|
+
|
|
91
|
+
class SlackAgent {
|
|
92
|
+
private matimo: MatimoInstance;
|
|
93
|
+
|
|
94
|
+
constructor() {
|
|
95
|
+
this.matimo = await MatimoInstance.init({ autoDiscover: true });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async sendMessage(channel: string, text: string) {
|
|
99
|
+
return await this.matimo.execute('slack-send-message', { channel, text });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
42
103
|
|
|
43
104
|
## 🔗 API Reference
|
|
44
105
|
|
|
45
|
-
All tools are based on official Slack Web API methods. See [Slack API Documentation](https://
|
|
106
|
+
All tools are based on official Slack Web API methods. See [Slack API Documentation](https://api.slack.com/methods).
|
|
107
|
+
|
|
108
|
+
| Tool | Slack API Method | Bot Scopes Required |
|
|
109
|
+
|------|------------------|-------------------|
|
|
110
|
+
| slack-send-message | chat.postMessage | chat:write |
|
|
111
|
+
| slack_send_channel_message | chat.postMessage | chat:write |
|
|
112
|
+
| slack_reply_to_message | chat.postMessage | chat:write |
|
|
113
|
+
| slack_send_dm | conversations.open + chat.postMessage | chat:write, im:write |
|
|
114
|
+
| slack-list-channels | conversations.list | channels:read, groups:read, im:read, mpim:read |
|
|
115
|
+
| slack_create_channel | conversations.create | channels:manage |
|
|
116
|
+
| slack_join_channel | conversations.join | channels:write |
|
|
117
|
+
| slack_set_channel_topic | conversations.setTopic | channels:write |
|
|
118
|
+
| slack_upload_file | files.getUploadURLExternal | files:write |
|
|
119
|
+
| slack_upload_file_v2 | files.getUploadURLExternal | files:write |
|
|
120
|
+
| slack_complete_file_upload | files.completeUploadExternal | files:write |
|
|
121
|
+
| slack_get_channel_history | conversations.history | channels:history |
|
|
122
|
+
| slack_get_thread_replies | conversations.replies | channels:history |
|
|
123
|
+
| slack_search_messages | search.messages | search:read |
|
|
124
|
+
| slack_add_reaction | reactions.add | reactions:write |
|
|
125
|
+
| slack_get_reactions | reactions.get | reactions:read |
|
|
126
|
+
| slack_get_user_info | users.info | users:read |
|
|
127
|
+
| slack-get-user | users.info | users:read |
|
|
128
|
+
|
|
129
|
+
## 📋 Tool Specifications
|
|
130
|
+
|
|
131
|
+
Each tool is defined in YAML with complete parameter validation and error handling. Tools include:
|
|
132
|
+
|
|
133
|
+
- **Parameter validation** with Zod schemas
|
|
134
|
+
- **OAuth2/bot token authentication** with automatic injection
|
|
135
|
+
- **Error handling** with structured error codes
|
|
136
|
+
- **Output validation** against defined schemas
|
|
137
|
+
|
|
138
|
+
## 🤝 Contributing
|
|
139
|
+
|
|
140
|
+
Found a bug or want to add a Slack tool? See [Contributing Guide](../../CONTRIBUTING.md) and [Adding Tools Guide](../tool-development/ADDING_TOOLS.md).
|
|
141
|
+
|
|
142
|
+
---
|
|
46
143
|
|
|
47
|
-
|
|
48
|
-
| -------------------------- | ------------------------------------ | -------------------- |
|
|
49
|
-
| slack-send-message | chat.postMessage | chat:write |
|
|
50
|
-
| slack_send_channel_message | chat.postMessage | chat:write |
|
|
144
|
+
**Part of the Matimo ecosystem** - Define tools once, use them everywhere! 🎯
|
|
51
145
|
| slack_reply_to_message | chat.postMessage | chat:write |
|
|
52
146
|
| slack_send_dm | conversations.open, chat.postMessage | im:write, chat:write |
|
|
53
147
|
| slack-list-channels | conversations.list | channels:read |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matimo/slack",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"description": "Slack workspace tools for Matimo",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"definition.yaml"
|
|
10
10
|
],
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"matimo": "
|
|
12
|
+
"matimo": "0.1.0-alpha.5"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"axios": "^1.13.4",
|
|
16
|
-
"@matimo/core": "0.1.0-alpha.
|
|
16
|
+
"@matimo/core": "0.1.0-alpha.5"
|
|
17
17
|
}
|
|
18
18
|
}
|