claude-threads 0.12.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/CHANGELOG.md +473 -0
- package/LICENSE +21 -0
- package/README.md +303 -0
- package/dist/changelog.d.ts +20 -0
- package/dist/changelog.js +134 -0
- package/dist/claude/cli.d.ts +42 -0
- package/dist/claude/cli.js +173 -0
- package/dist/claude/session.d.ts +256 -0
- package/dist/claude/session.js +1964 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +94 -0
- package/dist/git/worktree.d.ts +50 -0
- package/dist/git/worktree.js +228 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +371 -0
- package/dist/logo.d.ts +31 -0
- package/dist/logo.js +57 -0
- package/dist/mattermost/api.d.ts +85 -0
- package/dist/mattermost/api.js +124 -0
- package/dist/mattermost/api.test.d.ts +1 -0
- package/dist/mattermost/api.test.js +319 -0
- package/dist/mattermost/client.d.ts +56 -0
- package/dist/mattermost/client.js +321 -0
- package/dist/mattermost/emoji.d.ts +43 -0
- package/dist/mattermost/emoji.js +65 -0
- package/dist/mattermost/emoji.test.d.ts +1 -0
- package/dist/mattermost/emoji.test.js +131 -0
- package/dist/mattermost/types.d.ts +71 -0
- package/dist/mattermost/types.js +1 -0
- package/dist/mcp/permission-server.d.ts +2 -0
- package/dist/mcp/permission-server.js +201 -0
- package/dist/onboarding.d.ts +1 -0
- package/dist/onboarding.js +116 -0
- package/dist/persistence/session-store.d.ts +65 -0
- package/dist/persistence/session-store.js +127 -0
- package/dist/update-notifier.d.ts +3 -0
- package/dist/update-notifier.js +31 -0
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.js +42 -0
- package/dist/utils/logger.test.d.ts +1 -0
- package/dist/utils/logger.test.js +121 -0
- package/dist/utils/tool-formatter.d.ts +56 -0
- package/dist/utils/tool-formatter.js +247 -0
- package/dist/utils/tool-formatter.test.d.ts +1 -0
- package/dist/utils/tool-formatter.test.js +357 -0
- package/package.json +85 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.12.0] - 2025-12-29
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **Renamed project to `claude-threads`** - Complete rebrand from `mm-claude`
|
|
14
|
+
- npm package: `mattermost-claude-code` → `claude-threads`
|
|
15
|
+
- CLI command: `mm-claude` → `claude-threads`
|
|
16
|
+
- Config directory: `~/.config/mm-claude/` → `~/.config/claude-threads/`
|
|
17
|
+
- MCP server: `mm-claude-permissions` → `claude-threads-permissions`
|
|
18
|
+
- GitHub repository: `mattermost-claude-code` → `claude-threads`
|
|
19
|
+
- **New CT logo** - Stylized "CT" block characters replace the old "M" logo
|
|
20
|
+
- Fresh visual identity matching the new name
|
|
21
|
+
|
|
22
|
+
## [0.11.2] - 2025-12-28
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Fix worktree skip emoji** - Use emoji name `x` instead of Unicode `❌`
|
|
26
|
+
- Mattermost API expects emoji names for reactions, not Unicode characters
|
|
27
|
+
- Was causing "Custom emoji have been disabled" error
|
|
28
|
+
|
|
29
|
+
## [0.11.1] - 2025-12-28
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- **Fix worktree and `!cd` crash** - Claude CLI sessions are tied to working directory
|
|
33
|
+
- Can't use `--resume` when switching directories (session ID is directory-specific)
|
|
34
|
+
- Now generates fresh session ID when changing to worktree or new directory
|
|
35
|
+
- Previously caused "[Exited: 1]" with "No conversation found with session ID"
|
|
36
|
+
|
|
37
|
+
## [0.11.0] - 2025-12-28
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- **Git worktree support** - Isolate file changes between concurrent sessions
|
|
41
|
+
- Smart detection prompts for a branch when uncommitted changes or concurrent sessions exist
|
|
42
|
+
- Reply with a branch name to create a worktree, or react with ❌ to skip
|
|
43
|
+
- Inline syntax: `@bot on branch feature/x help me implement...`
|
|
44
|
+
- `!worktree <branch>` - Create and switch to a git worktree
|
|
45
|
+
- `!worktree list` - List all worktrees for the repo
|
|
46
|
+
- `!worktree switch <branch>` - Switch to an existing worktree
|
|
47
|
+
- `!worktree remove <branch>` - Remove a worktree
|
|
48
|
+
- `!worktree off` - Disable worktree prompts for this session
|
|
49
|
+
- Configure via `WORKTREE_MODE=off|prompt|require` (default: `prompt`)
|
|
50
|
+
- Worktrees persist after session ends (manual cleanup)
|
|
51
|
+
- Session header shows worktree info when active
|
|
52
|
+
|
|
53
|
+
## [0.10.11] - 2025-12-28
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- **Permission prompts now update after approval/denial** - Shows result inline
|
|
57
|
+
- "⚠️ Permission requested" → "✅ Allowed by @user" or "❌ Denied by @user"
|
|
58
|
+
- Consistent with plan approval and message approval behavior
|
|
59
|
+
|
|
60
|
+
## [0.10.10] - 2025-12-28
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
- **Fixed `!permissions interactive` command** - Now actually enables interactive permissions
|
|
64
|
+
- Previously, the command set a flag but didn't restart Claude CLI, so permissions didn't change
|
|
65
|
+
- Now properly restarts Claude CLI with the MCP permission server enabled
|
|
66
|
+
- Permission prompts (👍 Allow | ✅ Allow all | 👎 Deny) now appear as expected
|
|
67
|
+
- Conversation context is preserved via `--resume` flag
|
|
68
|
+
|
|
69
|
+
## [0.10.9] - 2025-12-28
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
- **Code quality refactoring** - Extracted shared utilities and added comprehensive test suite
|
|
73
|
+
- New `src/mattermost/api.ts` - Shared REST API layer for bot and MCP server
|
|
74
|
+
- New `src/utils/logger.ts` - Standardized logging with `mcpLogger` and `wsLogger`
|
|
75
|
+
- New `createInteractivePost()` helper for posts with reaction options
|
|
76
|
+
- Extracted emoji constants and helpers to `src/mattermost/emoji.ts`
|
|
77
|
+
- Extracted tool formatting to `src/utils/tool-formatter.ts`
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
- **125 unit tests** - Comprehensive test coverage for refactored modules
|
|
81
|
+
- API layer tests (21 tests)
|
|
82
|
+
- Emoji helper tests (31 tests)
|
|
83
|
+
- Tool formatter tests (58 tests)
|
|
84
|
+
- Logger tests (15 tests)
|
|
85
|
+
|
|
86
|
+
## [0.10.8] - 2025-12-28
|
|
87
|
+
|
|
88
|
+
### Changed
|
|
89
|
+
- **Improved Claude in Chrome tool display** - Chrome automation tools now display like the native CLI
|
|
90
|
+
- `🌐 **Chrome**[computer] \`screenshot\`` instead of `🔌 **computer** *(claude-in-chrome)*`
|
|
91
|
+
- Shows action details: `left_click at (608, 51)`, `type "search query"`, `scroll down`
|
|
92
|
+
- Consistent formatting across all Chrome tools (navigate, tabs, read_page, etc.)
|
|
93
|
+
|
|
94
|
+
## [0.10.7] - 2025-12-28
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
- **Fixed `!context` and `!cost` commands** - These commands now properly display output
|
|
98
|
+
- Claude Code slash commands (`/context`, `/cost`) output via `user` events with `<local-command-stdout>` tags
|
|
99
|
+
- Added handling for these events so the output is displayed in Mattermost
|
|
100
|
+
|
|
101
|
+
## [0.10.6] - 2025-12-28
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
- **Fixed diff display** - Removed misleading line numbers and noise from diffs
|
|
105
|
+
- No more fake `@@ -1,1 +1,1 @@` headers (we don't have real line numbers)
|
|
106
|
+
- No more `` noise
|
|
107
|
+
- Uses `diffLines()` for proper line-by-line change detection
|
|
108
|
+
- Shows context lines (unchanged parts) naturally
|
|
109
|
+
|
|
110
|
+
## [0.10.5] - 2025-12-28
|
|
111
|
+
|
|
112
|
+
### Changed
|
|
113
|
+
- **Improved diff display** - Edit operations now show unified diffs with context
|
|
114
|
+
- Uses standard unified diff format (like `git diff`)
|
|
115
|
+
- Shows 3 lines of context around changes
|
|
116
|
+
- More compact: changed lines shown once, not duplicated
|
|
117
|
+
- Line numbers in `@@ -X,Y +X,Y @@` format
|
|
118
|
+
|
|
119
|
+
## [0.10.4] - 2025-12-28
|
|
120
|
+
|
|
121
|
+
### Added
|
|
122
|
+
- **`--chrome` flag** - Enable Claude in Chrome integration
|
|
123
|
+
- Pass `--chrome` CLI flag or set `CLAUDE_CHROME=true` environment variable
|
|
124
|
+
- Allows Claude to control your Chrome browser for web automation
|
|
125
|
+
- Use `--no-chrome` to explicitly disable
|
|
126
|
+
- **Claude Code commands** - New session commands for context and cost management
|
|
127
|
+
- `!context` - Show context usage (tokens used/remaining)
|
|
128
|
+
- `!cost` - Show token usage and cost for this session
|
|
129
|
+
- `!compact` - Compress context to free up space (useful when running low on context)
|
|
130
|
+
- Commands are translated to Claude Code's `/context`, `/cost`, `/compact` slash commands
|
|
131
|
+
|
|
132
|
+
## [0.10.3] - 2025-12-28
|
|
133
|
+
|
|
134
|
+
### Changed
|
|
135
|
+
- **Improved task list UX**
|
|
136
|
+
- Progress indicator: `📋 **Tasks** (2/5 · 40%)`
|
|
137
|
+
- Elapsed time for in-progress tasks: `🔄 **Running tests...** (45s)`
|
|
138
|
+
- Better pending icon: `○` instead of `⬜` (no longer overlaps)
|
|
139
|
+
- **Tool output now shows elapsed time**
|
|
140
|
+
- Long-running tools (≥3s) show completion time: `↳ ✓ (12s)`
|
|
141
|
+
- Errors also show timing: `↳ ❌ Error (5s)`
|
|
142
|
+
|
|
143
|
+
### Fixed
|
|
144
|
+
- **Paused sessions now resume on new message** - messages to paused sessions were being ignored
|
|
145
|
+
- After ⏸️ interrupt, sending a new message in the thread now resumes the session
|
|
146
|
+
- Previously messages without @mention were ignored because the session was removed from memory
|
|
147
|
+
- Added `hasPausedSession()`, `resumePausedSession()`, and `getPersistedSession()` methods
|
|
148
|
+
|
|
149
|
+
## [0.10.2] - 2025-12-28
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
- Version number now displays directly after "claude-threads" in the logo instead of on a separate line
|
|
153
|
+
|
|
154
|
+
### Fixed
|
|
155
|
+
- **Interrupt (⏸️) no longer kills session** - sessions now pause and can be resumed
|
|
156
|
+
- Previously SIGINT caused Claude CLI to exit and the session was lost
|
|
157
|
+
- Now session is preserved and user can send a new message to continue
|
|
158
|
+
- Works with both ⏸️ reaction and `!escape`/`!interrupt` commands
|
|
159
|
+
- **Filter `<thinking>` tags from output** - Claude's internal thinking is no longer shown to users
|
|
160
|
+
- Previously `<thinking>...</thinking>` tags would appear literally in Mattermost messages
|
|
161
|
+
|
|
162
|
+
## [0.10.1] - 2025-12-28
|
|
163
|
+
|
|
164
|
+
### Fixed
|
|
165
|
+
- **`!kill` now works from any message** - previously only worked within active session threads
|
|
166
|
+
- Can now send `!kill` or `@bot !kill` as the very first message to emergency shutdown
|
|
167
|
+
- Useful when bot is misbehaving and you need to stop it immediately
|
|
168
|
+
|
|
169
|
+
## [0.10.0] - 2025-12-28
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
- **ASCII art logo** - Stylized "M" in Claude Code's block character style
|
|
173
|
+
- Shows on CLI startup with Mattermost blue and Claude orange colors
|
|
174
|
+
- Shows at the top of every Mattermost session thread
|
|
175
|
+
- Festive stars (✴) surround the logo
|
|
176
|
+
- **`!kill` command** - Emergency shutdown that kills ALL sessions and exits the bot
|
|
177
|
+
- Only available to globally authorized users (ALLOWED_USERS)
|
|
178
|
+
- Unpersists all sessions (they won't resume on restart)
|
|
179
|
+
- Posts notification to all active session threads before exiting
|
|
180
|
+
- **`!escape` / `!interrupt` commands** - Soft interrupt like pressing Escape in CLI
|
|
181
|
+
- Sends SIGINT to Claude CLI, stopping current task
|
|
182
|
+
- Session stays alive and user can continue the conversation
|
|
183
|
+
- Also available via ⏸️ reaction on any message in the session
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
- **Fix plan mode getting stuck after approval** - tool calls now get proper responses
|
|
187
|
+
- `ExitPlanMode` and `AskUserQuestion` now receive `tool_result` instead of user messages
|
|
188
|
+
- Claude was waiting for tool results that never came, causing sessions to hang
|
|
189
|
+
- Added `toolUseId` tracking to `PendingApproval` interface
|
|
190
|
+
|
|
191
|
+
## [0.9.3] - 2025-12-28
|
|
192
|
+
|
|
193
|
+
### Fixed
|
|
194
|
+
- **Major fix for session persistence** - completely rewrote session lifecycle management
|
|
195
|
+
- Sessions now correctly survive bot restarts (was broken in 0.9.0-0.9.2)
|
|
196
|
+
- `killAllSessions()` now explicitly preserves persistence instead of relying on exit event timing
|
|
197
|
+
- `killSession()` now takes an `unpersist` parameter to control persistence behavior
|
|
198
|
+
- `handleExit()` now only unpersists on graceful exits (code 0), not on errors
|
|
199
|
+
- Resumed sessions that fail are preserved for retry instead of being removed
|
|
200
|
+
- Added comprehensive debug logging to trace session lifecycle
|
|
201
|
+
- Race condition between shutdown and exit events eliminated
|
|
202
|
+
|
|
203
|
+
## [0.9.2] - 2025-12-28
|
|
204
|
+
|
|
205
|
+
### Fixed
|
|
206
|
+
- **Fix session persistence** - sessions were being incorrectly cleaned as "stale" on startup
|
|
207
|
+
- The `cleanStale()` call was removing sessions older than 30 minutes before attempting to resume
|
|
208
|
+
- Now sessions survive bot restarts regardless of how long the bot was down
|
|
209
|
+
- Added debug logging (`DEBUG=1`) to trace persistence operations
|
|
210
|
+
- **Fix crash on Mattermost API errors** - bot no longer crashes when posts fail
|
|
211
|
+
- Added try-catch around message handler to prevent unhandled exceptions
|
|
212
|
+
- Added try-catch around reaction handler
|
|
213
|
+
- Graceful error handling when session start post fails (e.g., deleted thread)
|
|
214
|
+
|
|
215
|
+
## [0.9.1] - 2025-12-28
|
|
216
|
+
|
|
217
|
+
### Changed
|
|
218
|
+
- Resume message now shows version: "Session resumed after bot restart (v0.9.1)"
|
|
219
|
+
- Session header is updated with new version after resume
|
|
220
|
+
|
|
221
|
+
### Fixed
|
|
222
|
+
- Fix duplicate "Bot shutting down" messages when stopping bot
|
|
223
|
+
- Fix "[Exited: null]" message appearing during graceful shutdown
|
|
224
|
+
|
|
225
|
+
## [0.9.0] - 2025-12-28
|
|
226
|
+
|
|
227
|
+
### Added
|
|
228
|
+
- **Session persistence** - Sessions now survive bot restarts!
|
|
229
|
+
- Active sessions are saved to `~/.config/claude-threads/sessions.json`
|
|
230
|
+
- On bot restart, sessions are automatically resumed using Claude's `--resume` flag
|
|
231
|
+
- Users see "Bot shutting down - session will resume" when bot stops
|
|
232
|
+
- Users see "Session resumed after bot restart" when session resumes
|
|
233
|
+
- Session state (participants, working dir, permissions) is preserved
|
|
234
|
+
- Stale sessions (older than SESSION_TIMEOUT_MS) are cleaned up on startup
|
|
235
|
+
- Thread existence is verified before resuming (deleted threads are skipped)
|
|
236
|
+
|
|
237
|
+
### Fixed
|
|
238
|
+
- Truncate messages longer than 16K chars to avoid Mattermost API errors
|
|
239
|
+
|
|
240
|
+
## [0.8.1] - 2025-12-28
|
|
241
|
+
|
|
242
|
+
### Added
|
|
243
|
+
- **`!release-notes` command** - Show release notes for the current version
|
|
244
|
+
- **"What's new" in session header** - Shows a brief summary of new features when starting a session
|
|
245
|
+
|
|
246
|
+
## [0.8.0] - 2025-12-28
|
|
247
|
+
|
|
248
|
+
### Added
|
|
249
|
+
- **Image attachment support** - Attach images to your messages and Claude Code will analyze them
|
|
250
|
+
- Supports JPEG, PNG, GIF, and WebP formats
|
|
251
|
+
- Images are downloaded from Mattermost and sent to Claude as base64-encoded content blocks
|
|
252
|
+
- Works for both new sessions and follow-up messages
|
|
253
|
+
- Debug logging shows attached image details (name, type, size)
|
|
254
|
+
|
|
255
|
+
## [0.7.3] - 2025-12-28
|
|
256
|
+
|
|
257
|
+
### Fixed
|
|
258
|
+
- Actually fix `!cd` showing "[Exited: null]" - reset flag in async exit handler, not synchronously
|
|
259
|
+
|
|
260
|
+
## [0.7.2] - 2025-12-28
|
|
261
|
+
|
|
262
|
+
### Fixed
|
|
263
|
+
- Fix `!cd` command showing "[Exited: null]" message - now properly suppresses exit message during intentional restart
|
|
264
|
+
|
|
265
|
+
## [0.7.1] - 2025-12-28
|
|
266
|
+
|
|
267
|
+
### Fixed
|
|
268
|
+
- Fix infinite loop when plan is approved - no longer sends "Continue" message on subsequent ExitPlanMode calls
|
|
269
|
+
|
|
270
|
+
## [0.7.0] - 2025-12-28
|
|
271
|
+
|
|
272
|
+
### Added
|
|
273
|
+
- **`!cd <path>` command** - Change working directory mid-session
|
|
274
|
+
- Restarts Claude Code in the new directory with fresh context
|
|
275
|
+
- Session header updates to show current working directory
|
|
276
|
+
- Validates directory exists before switching
|
|
277
|
+
|
|
278
|
+
## [0.6.1] - 2025-12-28
|
|
279
|
+
|
|
280
|
+
### Changed
|
|
281
|
+
- Cleaner console output: removed verbose `[Session]` prefixes from logs
|
|
282
|
+
- Debug-only logging for internal session state changes (plan approval, question handling)
|
|
283
|
+
- Consistent emoji formatting for all log messages
|
|
284
|
+
|
|
285
|
+
## [0.6.0] - 2025-12-28
|
|
286
|
+
|
|
287
|
+
### Added
|
|
288
|
+
- **Auto-update notifications** - shows banner in session header when new version is available
|
|
289
|
+
- Checks npm registry on startup for latest version
|
|
290
|
+
- Update notice includes install command: `npm install -g claude-threads`
|
|
291
|
+
|
|
292
|
+
## [0.5.9] - 2025-12-28
|
|
293
|
+
|
|
294
|
+
### Fixed
|
|
295
|
+
- Security fix: sanitize bot username in regex to prevent injection
|
|
296
|
+
|
|
297
|
+
## [0.5.8] - 2025-12-28
|
|
298
|
+
|
|
299
|
+
### Changed
|
|
300
|
+
- Commands now use `!` prefix instead of `/` to avoid Mattermost slash command conflicts
|
|
301
|
+
- `!help`, `!invite`, `!kick`, `!permissions`, `!stop` replace `/` versions
|
|
302
|
+
- Commands without prefix (`help`, `stop`, `cancel`) still work
|
|
303
|
+
|
|
304
|
+
## [0.5.7] - 2025-12-28
|
|
305
|
+
|
|
306
|
+
### Fixed
|
|
307
|
+
- Bot now recognizes mentions with hyphens in username (e.g., `@annes-minion`)
|
|
308
|
+
- Side conversation detection regex updated to handle full Mattermost usernames
|
|
309
|
+
|
|
310
|
+
## [0.5.6] - 2025-12-28
|
|
311
|
+
|
|
312
|
+
### Added
|
|
313
|
+
- Timeout warning 5 minutes before session expires
|
|
314
|
+
- Warning message tells user to send a message to keep session alive
|
|
315
|
+
- Warning resets if activity resumes
|
|
316
|
+
|
|
317
|
+
## [0.5.5] - 2025-12-28
|
|
318
|
+
|
|
319
|
+
### Added
|
|
320
|
+
- `/help` command to show available session commands
|
|
321
|
+
|
|
322
|
+
### Changed
|
|
323
|
+
- Replace ASCII diagram with Mermaid flowchart in README
|
|
324
|
+
|
|
325
|
+
## [0.5.4] - 2025-12-28 (not released)
|
|
326
|
+
|
|
327
|
+
### Added
|
|
328
|
+
- `/help` command to show available session commands
|
|
329
|
+
|
|
330
|
+
## [0.5.3] - 2025-12-28
|
|
331
|
+
|
|
332
|
+
### Added
|
|
333
|
+
- `/permissions interactive` command to enable interactive permissions for a session
|
|
334
|
+
- Can only downgrade permissions (auto → interactive), not upgrade
|
|
335
|
+
- Session header updates to show current permission mode
|
|
336
|
+
|
|
337
|
+
## [0.5.2] - 2025-12-28
|
|
338
|
+
|
|
339
|
+
### Changed
|
|
340
|
+
- Complete README rewrite with full documentation of all features
|
|
341
|
+
|
|
342
|
+
## [0.5.1] - 2025-12-28
|
|
343
|
+
|
|
344
|
+
### Added
|
|
345
|
+
- `--no-skip-permissions` flag to enable interactive permissions even when `SKIP_PERMISSIONS=true` is set in env
|
|
346
|
+
|
|
347
|
+
## [0.5.0] - 2025-12-28
|
|
348
|
+
|
|
349
|
+
### Added
|
|
350
|
+
- **Session collaboration** - invite users to specific sessions without global access
|
|
351
|
+
- **`/invite @username`** - Temporarily allow a user to participate in the current session
|
|
352
|
+
- **`/kick @username`** - Remove an invited user from the current session
|
|
353
|
+
- **Message approval flow** - When unauthorized users send messages in a session thread, the session owner/allowed users can approve via reactions:
|
|
354
|
+
- 👍 Allow this single message
|
|
355
|
+
- ✅ Invite them to the session
|
|
356
|
+
- 👎 Deny the message
|
|
357
|
+
- Per-session allowlist tracked via `sessionAllowedUsers` in each session
|
|
358
|
+
- **Side conversation support** - Messages starting with `@someone-else` are ignored, allowing users to chat without triggering the bot
|
|
359
|
+
- **Dynamic session header** - The session start message updates to show current participants when users are invited or kicked
|
|
360
|
+
|
|
361
|
+
### Changed
|
|
362
|
+
- Session owner is automatically added to session allowlist
|
|
363
|
+
- Authorization checks now use `isUserAllowedInSession()` for follow-ups
|
|
364
|
+
- Globally allowed users can still access all sessions
|
|
365
|
+
|
|
366
|
+
## [0.4.0] - 2025-12-28
|
|
367
|
+
|
|
368
|
+
### Added
|
|
369
|
+
- **CLI arguments** to override all config options (`--url`, `--token`, `--channel`, etc.)
|
|
370
|
+
- **Interactive onboarding** when no `.env` file exists - guided setup with help text
|
|
371
|
+
- Full `--help` output with all available options
|
|
372
|
+
- `--debug` flag to enable verbose logging
|
|
373
|
+
|
|
374
|
+
### Changed
|
|
375
|
+
- Switched from manual arg parsing to `commander` for better CLI experience
|
|
376
|
+
- Config now supports: CLI args > environment variables > defaults
|
|
377
|
+
|
|
378
|
+
## [0.3.4] - 2025-12-27
|
|
379
|
+
|
|
380
|
+
### Added
|
|
381
|
+
- Cancel sessions with `/stop`, `/cancel`, `stop`, or `cancel` commands in thread
|
|
382
|
+
- Cancel sessions by reacting with ❌ or 🛑 to any post in the thread
|
|
383
|
+
|
|
384
|
+
## [0.3.3] - 2025-12-27
|
|
385
|
+
|
|
386
|
+
### Added
|
|
387
|
+
- WebSocket heartbeat to detect dead connections after laptop sleep/idle
|
|
388
|
+
- Automatic reconnection when connection goes silent for 60+ seconds
|
|
389
|
+
- Ping every 30 seconds to keep connection alive
|
|
390
|
+
|
|
391
|
+
### Fixed
|
|
392
|
+
- Connections no longer go "zombie" after laptop sleep - claude-threads now detects and reconnects
|
|
393
|
+
|
|
394
|
+
## [0.3.2] - 2025-12-27
|
|
395
|
+
|
|
396
|
+
### Fixed
|
|
397
|
+
- Session card now correctly shows "claude-threads" instead of "Claude Code"
|
|
398
|
+
|
|
399
|
+
## [0.3.1] - 2025-12-27
|
|
400
|
+
|
|
401
|
+
### Changed
|
|
402
|
+
- Cleaner console output with colors (verbose logs only shown with `DEBUG=1`)
|
|
403
|
+
- Pimped session start card in Mattermost with version, directory, user, session count, permissions mode, and prompt preview
|
|
404
|
+
- Typing indicator starts immediately when session begins
|
|
405
|
+
- Shortened thread IDs in logs for readability
|
|
406
|
+
|
|
407
|
+
## [0.3.0] - 2025-12-27
|
|
408
|
+
|
|
409
|
+
### Added
|
|
410
|
+
- **Multiple concurrent sessions** - each Mattermost thread gets its own Claude CLI process
|
|
411
|
+
- Sessions tracked via `sessions: Map<threadId, Session>` and `postIndex: Map<postId, threadId>`
|
|
412
|
+
- Configurable session limits via `MAX_SESSIONS` env var (default: 5)
|
|
413
|
+
- Automatic idle session cleanup via `SESSION_TIMEOUT_MS` env var (default: 30 min)
|
|
414
|
+
- `killAllSessions()` for graceful shutdown of all sessions
|
|
415
|
+
- Session count logging for monitoring
|
|
416
|
+
|
|
417
|
+
### Changed
|
|
418
|
+
- `SessionManager` now manages multiple sessions instead of single session
|
|
419
|
+
- `sendFollowUp(threadId, message)` takes threadId parameter
|
|
420
|
+
- `isInSessionThread(threadId)` replaces `isInCurrentSessionThread()`
|
|
421
|
+
- `killSession(threadId)` takes threadId parameter
|
|
422
|
+
|
|
423
|
+
### Fixed
|
|
424
|
+
- Reaction routing now uses post index lookup for correct session targeting
|
|
425
|
+
|
|
426
|
+
## [0.2.3] - 2025-12-27
|
|
427
|
+
|
|
428
|
+
### Added
|
|
429
|
+
- GitHub Actions workflow for automated npm publishing on release
|
|
430
|
+
|
|
431
|
+
## [0.2.2] - 2025-12-27
|
|
432
|
+
|
|
433
|
+
### Added
|
|
434
|
+
- Comprehensive `CLAUDE.md` with project documentation for AI assistants
|
|
435
|
+
|
|
436
|
+
## [0.2.1] - 2025-12-27
|
|
437
|
+
|
|
438
|
+
### Added
|
|
439
|
+
- `--version` / `-v` flag to display version
|
|
440
|
+
- Version number shown in `--help` output
|
|
441
|
+
|
|
442
|
+
### Changed
|
|
443
|
+
- Lazy config loading (no .env file needed for --version/--help)
|
|
444
|
+
|
|
445
|
+
## [0.2.0] - 2025-12-27
|
|
446
|
+
|
|
447
|
+
### Added
|
|
448
|
+
- Interactive permission approval via Mattermost reactions
|
|
449
|
+
- Permission prompts forwarded to Mattermost thread
|
|
450
|
+
- React with 👍 to allow, ✅ to allow all, or 👎 to deny
|
|
451
|
+
- Only authorized users (ALLOWED_USERS) can approve permissions
|
|
452
|
+
- MCP-based permission server using Claude Code's `--permission-prompt-tool`
|
|
453
|
+
- `SKIP_PERMISSIONS` env var to control permission behavior
|
|
454
|
+
|
|
455
|
+
### Changed
|
|
456
|
+
- Permissions are now interactive by default (previously skipped)
|
|
457
|
+
- Use `SKIP_PERMISSIONS=true` or `--dangerously-skip-permissions` to skip
|
|
458
|
+
|
|
459
|
+
## [0.1.0] - 2024-12-27
|
|
460
|
+
|
|
461
|
+
### Added
|
|
462
|
+
- Initial release
|
|
463
|
+
- Connect Claude Code CLI to Mattermost channels
|
|
464
|
+
- Real-time streaming of Claude responses
|
|
465
|
+
- Interactive plan approval with emoji reactions
|
|
466
|
+
- Sequential question flow with emoji answers
|
|
467
|
+
- Task list display with live updates
|
|
468
|
+
- Code diffs for Edit operations
|
|
469
|
+
- Content preview for Write operations
|
|
470
|
+
- Subagent status tracking
|
|
471
|
+
- Typing indicator while Claude is processing
|
|
472
|
+
- User allowlist for access control
|
|
473
|
+
- Bot mention detection for triggering sessions
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Anne Schuth
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|