Added support for managing multiple workspaces including:
- New workspace bind command to link existing directories
- Enhanced session management scoped to workspaces
- Improved error handling with localized messages
- Fixed interactive state lookup for multi-workspace contexts
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add opt-in `inject_sender` config option for projects. When enabled,
cc-connect prepends a metadata line to each message before forwarding
to the agent:
[cc-connect sender_id=ou_abc123 platform=feishu]
<original message>
This allows agents (Claude Code, Codex, etc.) to identify who sent the
message and adjust behavior accordingly — e.g. personal task views,
role-based access control, or per-user tone.
The feature is off by default and can be enabled per-project:
[[projects]]
inject_sender = true
Closes#91
* feat: add multi-workspace mode and base_dir config fields
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add WorkspaceBindingManager for channel-to-workspace persistence
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add workspacePool for managing per-workspace agent state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add ChannelNameResolver interface and Slack implementation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add multi-workspace fields, SetMultiWorkspace, and idle reaper to Engine
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add resolveWorkspace method for channel-to-directory mapping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: wire multi-workspace mode setup in main.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add workspace init flow for cloning repos and binding channels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add /workspace commands (init, unbind, list, status)
Add handleWorkspaceCommand with subcommands:
- (no args): show current workspace binding for the channel
- init <git-url>: clone repo and bind workspace to channel
- unbind: remove workspace binding from channel
- list: show all workspace bindings for the project
Only available when multi-workspace mode is enabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: wire multi-workspace routing into handleMessage with per-workspace agents
Add workspace resolution to handleMessage that resolves channels to workspace
directories, creates per-workspace agents with correct work_dir, and routes
messages through workspace-specific session managers. The normal (single-workspace)
code path is unchanged — all new logic is gated behind e.multiWorkspace.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add integration tests for multi-workspace resolution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve multi-workspace bugs found during live testing
Three bugs fixed:
1. App mention events not handled - Slack sends `app_mention` events
(not `message.channels`) when the bot is @mentioned. Added
AppMentionEvent handler in the Slack platform.
2. Bot mention prefix not stripped - app_mention text includes
`<@UBOTID> ` prefix, breaking command parsing and workspace
resolution. Now stripped before passing to engine.
3. Slash command syntax incompatible with Slack - `/workspace` commands
were being intercepted by Slack as slash commands. Changed all
user-facing references and prefix detection to use `workspace`
without the leading slash.
Also added debug logging to handleEvent for diagnosing event delivery.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: instruct agent to use Slack mrkdwn formatting
Add Slack formatting guidelines to the agent system prompt so responses
use Slack's mrkdwn syntax instead of standard Markdown (e.g. *bold*
instead of **bold**, no ## headings).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Add support for rich permission prompts using interactive cards when platforms support them. CardButtons now support Extra field for callback data. Implement fallback chain: inline buttons → cards → plain text. Includes i18n support and tests for all platforms.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add nil checks for card operations in core engine.
Improve token redaction utility and error handling.
Initialize delete mode state properly.
Fix error message in cc-connect update.
Add missing platform allowFrom checks.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(cards): interactive card UI for slash commands on Feishu
- Add platform-agnostic Card model (core/card.go) with builder API
- Add CardSender/CardNavigable interfaces (core/interfaces.go)
- Implement Feishu card renderer using column_set for mobile layout
- Redesign all slash command responses to use interactive cards
- Add handleCardNav router and executeCardAction for in-place updates
- Convert /new /quiet /switch /stop to act: and nav: actions
- /help card uses tab buttons grouped by Session/Agent/Tools/System
- renderUpgradeCard: sync update check with 8s timeout
- Fix: return error card instead of nil in handleCardNav /list /switch
Made-with: Cursor
* fix(cards): address PR #52 review feedback
- Add enable_feishu_card config option (default true) so operators can
fall back to plain-text replies when card permissions are unavailable;
wraps Platform in interactivePlatform only when cards are enabled
- Fix goroutine leak in renderUpgradeCard: use buffered channel (cap 1)
so the background goroutine can always complete even after a timeout
- Fix /stop concurrent logic in executeCardAction: consolidate state
mutation under a single interactiveMu critical section
- Fix code indentation in platform/feishu/card.go (action map and
CardSelect/CardNote case blocks)
- Add unit tests for Card.RenderText and Card.HasButtons (core/card_test.go)
- Add Feishu platform tests for ReplyCard/SendCard and card renderer
(platform/feishu/platform_test.go)
- Update docs/feishu.md and README with enable_feishu_card option
Made-with: Cursor
Add `/bind setup` command to write relay instructions to memory file.
Implement SystemPromptSupporter interface to detect native prompt support.
Add related i18n messages for setup flow and hint messages.
Update bind command to show setup hint when needed.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add drainEvents utility to clear buffered events between turns and apply it in processInteractiveMessage and cmdCompress to avoid processing stale events from previous agent interactions.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Refactor TTS configuration to use pointer type and add validation for TTS mode. Update help messages to include TTS command documentation. Fix ffmpeg command construction for audio conversion.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
The idle timer in processInteractiveEvents kept running while
the event loop was blocked waiting for a user permission response.
If the user took longer than eventIdleTimeout to respond, the timer
would fire and kill the session on the next loop iteration.
Stop the idle timer before waiting on pending.Resolved and restart
it after the permission is resolved.
Move compression logic to async goroutine with proper state handling.
Add event processing with timeout and cleanup.
Add i18n support for compression done message.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add new i18n message keys for various command responses (switch, timeout, relay bindings).
Improve formatting of command list output with better descriptions and shell command display.
Adjust Feishu platform message type detection threshold for posts.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Updated iFlow CLI integration flags from `-p` to `-i` for interactive mode.
Modified quiet mode handling to preserve state across session stops.
Added shell command support in i18n messages.
Fixed empty tool ID handling in iFlow session.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add new `/shell` command (with aliases `/sh`, `/exec`, `/run`) to execute shell commands and return output. Includes timeout handling, working directory detection, output trimming, and error handling. Also adds command documentation in all supported languages.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
- add BotCommandInfo and CommandRegistrar interface for platform abstraction
- implement GetAllCommands to collect builtin/custom commands and skills
- add i18n descriptions for all 30 builtin commands (en/zh/zh-TW/ja/es)
- implement RegisterCommands for Telegram setMyCommands API integration
- Add AddToBind() method to incrementally add projects to binding
- Add RemoveFromBind() method to remove specific project from binding
- Update /bind command to support multiple projects:
- /bind <project> - add project to binding
- /bind -<project> - remove specific project
- /bind remove - clear all bindings
- Add debug logging for telegram group message filtering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ability to define custom slash commands that execute shell commands directly:
- Extend CommandConfig with Exec and WorkDir fields
- Add cmdCommandsAddExec handler for exec commands
- Implement executeShellCommand with timeout and output handling
- Add work_dir support for exec commands
- Update documentation and i18n messages
- Add tests and error handling
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add support for configuring agent idle timeout duration via config file
(idle_timeout_mins). Defaults to 2 hours (changed from previous fixed 30 mins).
Timeout can be disabled by setting to 0.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Adjust eventIdleTimeout constant from 5 to 30 minutes to better handle agent response scenarios. Also includes minor code formatting cleanup in Engine struct.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
- Add quiet mode status to /status command with i18n support
- Fix Feishu help command line breaks (use buildPostJSON instead of md tag)
- Improve tool message formatting (code block for long content)
- Strip XML tags from session summary display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Optimize the splitMessage function to handle newline boundaries more intelligently by checking if the boundary is in the second half of the chunk. Also simplifies the chunking logic and improves variable scoping.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Change engine startup to continue with partial failures instead of exiting.
Handle .old binary paths correctly during restarts. Update logging to reflect
partial startup status and improve restart reliability after updates.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Implement new `/search` command that allows searching sessions by:
- Session name or summary (case-insensitive)
- Session ID prefix
Adds internationalization support and usage documentation
Includes error handling and formatted results output
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
The cmdList function now accepts page arguments and displays paginated results. Added new i18n messages for paginated titles and hints. Implemented page size constant and page calculation logic.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Added eventIdleTimeout constant and idle timer logic to detect and handle stuck agent sessions that stop emitting events. The timer resets on each new event and terminates the session if no events are received within 5 minutes.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add platform-specific restart handling with restart_unix.go and restart_windows.go. Enhance updater to support Gitee mirrors for Chinese users and automatically restart after updates. Improve version display in restart notifications and streamline update messages.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
This commit introduces a new relay system for bot-to-bot communication, including:
- New `relay` command with send/bind functionality
- RelayManager for coordinating messages between engines
- API endpoints for relay operations
- Interactive `/bind` command for chat group binding
- Session handling and message forwarding
- CLI documentation and help messages
- Internationalization support for relay messages
- Stream preview improvements for relay messages
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
- Improved `/switch` command to support session names and better matching logic
- Refactored markdown-to-HTML conversion with proper tag nesting and quote escaping
- Added detailed logging for streaming preview operations
- Fixed HTML tag validation in markdown tests
- Updated Telegram platform to handle HTML parsing errors gracefully
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Typing Indicator:
- Add TypingIndicator interface for "processing" feedback
- Discord: send typing status every 8 seconds
- Telegram: send chat typing action every 5 seconds
- Feishu: add emoji reaction, remove when done
Markdown HTML Escaping:
- Fix HTML special chars (<, >, &) escaping in all contexts
- Use placeholder strategy: extract code/links, escape all, restore
Streaming Preview:
- Remove trailing cursor character from preview messages
Feishu Card:
- Add wide_screen_mode config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Streaming Preview:
- Add freeze() method to pause preview on permission prompts
- Improve finish() logic for better edge case handling
Markdown Rendering:
- Telegram: switch from Markdown to HTML mode with MarkdownToTelegramHTML
- Discord: use code-fence-aware message splitting
- Feishu: dual rendering strategy (card for code/tables, post for text)
- Feishu: support links, italic, strikethrough in inline parsing
- Feishu: use Patch API for card message updates
i18n:
- Use code blocks for permission prompt content
- Simplify button labels (remove emoji)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Streaming Preview:
- Real-time message preview during agent response (like "typing" indicator)
- Supported on Telegram, Discord, and Feishu
- Configurable interval, min delta chars, and max preview length
Rate Limiting:
- Per-session sliding-window rate limiter
- Prevents users from flooding the bot with messages
- Configurable max messages and window size
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unnecessary fmt.Sprintf wrapper around i18n.T() calls
- Add comprehensive unit tests for core module components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>