mattermost-claude-code 0.5.7 → 0.5.8
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/README.md +13 -11
- package/dist/index.js +16 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,15 +111,17 @@ CLI options override environment variables.
|
|
|
111
111
|
|
|
112
112
|
## Session Commands
|
|
113
113
|
|
|
114
|
-
Type
|
|
114
|
+
Type `!help` in any session thread to see available commands:
|
|
115
115
|
|
|
116
116
|
| Command | Description |
|
|
117
117
|
|:--------|:------------|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
118
|
+
| `!help` | Show available commands |
|
|
119
|
+
| `!invite @user` | Invite a user to this session |
|
|
120
|
+
| `!kick @user` | Remove an invited user |
|
|
121
|
+
| `!permissions interactive` | Enable interactive permissions |
|
|
122
|
+
| `!stop` | Stop this session |
|
|
123
|
+
|
|
124
|
+
> **Note:** Commands use `!` prefix instead of `/` to avoid conflicts with Mattermost's slash commands.
|
|
123
125
|
|
|
124
126
|
## Session Collaboration
|
|
125
127
|
|
|
@@ -128,7 +130,7 @@ Type `/help` in any session thread to see available commands:
|
|
|
128
130
|
Session owners can temporarily allow others to participate:
|
|
129
131
|
|
|
130
132
|
```
|
|
131
|
-
|
|
133
|
+
!invite @colleague
|
|
132
134
|
```
|
|
133
135
|
|
|
134
136
|
The colleague can now send messages in this session thread.
|
|
@@ -138,7 +140,7 @@ The colleague can now send messages in this session thread.
|
|
|
138
140
|
Remove an invited user from the session:
|
|
139
141
|
|
|
140
142
|
```
|
|
141
|
-
|
|
143
|
+
!kick @colleague
|
|
142
144
|
```
|
|
143
145
|
|
|
144
146
|
### Message Approval
|
|
@@ -161,7 +163,7 @@ Messages starting with `@someone-else` are ignored by the bot, allowing side con
|
|
|
161
163
|
If the bot is running with `--skip-permissions` (auto mode), you can enable interactive permissions for a specific session:
|
|
162
164
|
|
|
163
165
|
```
|
|
164
|
-
|
|
166
|
+
!permissions interactive
|
|
165
167
|
```
|
|
166
168
|
|
|
167
169
|
This allows collaboration by requiring approval for Claude's actions. Note: you can only downgrade (auto → interactive), not upgrade - this ensures security.
|
|
@@ -222,7 +224,7 @@ The session start message shows current status and updates when participants cha
|
|
|
222
224
|
|
|
223
225
|
Stop a running session:
|
|
224
226
|
|
|
225
|
-
- Type
|
|
227
|
+
- Type `!stop` or `!cancel` in the thread
|
|
226
228
|
- React with ❌ or 🛑 to any message in the thread
|
|
227
229
|
|
|
228
230
|
## Access Control
|
|
@@ -235,7 +237,7 @@ ALLOWED_USERS=alice,bob,carol
|
|
|
235
237
|
|
|
236
238
|
- Only listed users can start sessions
|
|
237
239
|
- Only listed users can approve permissions
|
|
238
|
-
- Session owners can
|
|
240
|
+
- Session owners can `!invite` others temporarily
|
|
239
241
|
- Empty = anyone can use (be careful!)
|
|
240
242
|
|
|
241
243
|
## Environment Variables
|
package/dist/index.js
CHANGED
|
@@ -84,42 +84,43 @@ async function main() {
|
|
|
84
84
|
: message.trim();
|
|
85
85
|
const lowerContent = content.toLowerCase();
|
|
86
86
|
// Check for stop/cancel commands (only from allowed users)
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
// Note: Using ! prefix instead of / to avoid Mattermost slash command interception
|
|
88
|
+
if (lowerContent === '!stop' || lowerContent === 'stop' ||
|
|
89
|
+
lowerContent === '!cancel' || lowerContent === 'cancel') {
|
|
89
90
|
if (session.isUserAllowedInSession(threadRoot, username)) {
|
|
90
91
|
await session.cancelSession(threadRoot, username);
|
|
91
92
|
}
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
|
-
// Check for
|
|
95
|
-
if (lowerContent === '
|
|
95
|
+
// Check for !help command
|
|
96
|
+
if (lowerContent === '!help' || lowerContent === 'help') {
|
|
96
97
|
await mattermost.createPost(`**Available commands:**\n\n` +
|
|
97
98
|
`| Command | Description |\n` +
|
|
98
99
|
`|:--------|:------------|\n` +
|
|
99
|
-
`|
|
|
100
|
-
`|
|
|
101
|
-
`|
|
|
102
|
-
`|
|
|
103
|
-
`|
|
|
100
|
+
`| \`!help\` | Show this help message |\n` +
|
|
101
|
+
`| \`!invite @user\` | Invite a user to this session |\n` +
|
|
102
|
+
`| \`!kick @user\` | Remove an invited user |\n` +
|
|
103
|
+
`| \`!permissions interactive\` | Enable interactive permissions |\n` +
|
|
104
|
+
`| \`!stop\` | Stop this session |\n\n` +
|
|
104
105
|
`**Reactions:**\n` +
|
|
105
106
|
`- 👍 Approve action · ✅ Approve all · 👎 Deny\n` +
|
|
106
107
|
`- ❌ or 🛑 on any message to stop session`, threadRoot);
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
|
-
// Check for
|
|
110
|
-
const inviteMatch = content.match(
|
|
110
|
+
// Check for !invite command
|
|
111
|
+
const inviteMatch = content.match(/^!invite\s+@?([\w.-]+)/i);
|
|
111
112
|
if (inviteMatch) {
|
|
112
113
|
await session.inviteUser(threadRoot, inviteMatch[1], username);
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
|
-
// Check for
|
|
116
|
-
const kickMatch = content.match(
|
|
116
|
+
// Check for !kick command
|
|
117
|
+
const kickMatch = content.match(/^!kick\s+@?([\w.-]+)/i);
|
|
117
118
|
if (kickMatch) {
|
|
118
119
|
await session.kickUser(threadRoot, kickMatch[1], username);
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
|
-
// Check for
|
|
122
|
-
const permMatch = content.match(
|
|
122
|
+
// Check for !permissions command
|
|
123
|
+
const permMatch = content.match(/^!permissions?\s+(interactive|auto)/i);
|
|
123
124
|
if (permMatch) {
|
|
124
125
|
const mode = permMatch[1].toLowerCase();
|
|
125
126
|
if (mode === 'interactive') {
|