Commit Graph
117 Commits
Author SHA1 Message Date
cg33 9a2fc734c9 Merge branch 'main' into feat/inject-sender-info 2026-03-13 09:32:08 +08:00
chenhg5andClaude 07cd76f2bb feat(workspace): add multi-workspace support with bind command and i18n messages
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>
2026-03-13 09:13:49 +08:00
sean2077 55b624deab feat: add chat_id to inject_sender preamble
Include chat_id (extracted from session key) in the agent prompt
preamble so the agent can distinguish which group/channel a message
came from.
2026-03-13 09:02:56 +08:00
sean2077 a1f70177ac feat: inject message sender identity into agent prompt
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
2026-03-12 20:59:42 +08:00
q107580018andmac 949cf1a8f1 feat: add usage command for codex oauth (#80)
Co-authored-by: mac <mac@Mac-mini.local>
2026-03-12 19:39:50 +08:00
Leigh StillardandClaude Opus 4.6 647398f765 feat: multi-workspace mode — single bot, multiple workspaces per channel (#79)
* 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>
2026-03-12 19:38:58 +08:00
chenhg5andClaude b84bbfc43f feat(i18n): add note text for permission card
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-12 08:06:06 +08:00
chenhg5andClaude 670b57021b feat(core): add card-based permission prompts with callback support
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>
2026-03-12 07:57:47 +08:00
chenhg5andClaude 47df97e35d feat(admin): add admin privilege system for privileged commands
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-12 07:26:28 +08:00
chenhg5andClaude 90f0e22f73 fix(core): handle nil cards and improve error handling
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>
2026-03-12 06:28:35 +08:00
Shawn ae13e2331a fix(security): harden access control, socket permissions, and token redaction (#68)
1. Unix socket permissions: 0o660 → 0o600 (owner-only access), preventing
   other processes in the same group from injecting messages via the API.

2. Telegram bot token redaction: when file downloads fail, the bot token
   embedded in the Telegram API URL is now replaced with [REDACTED] in
   error messages to prevent token leakage in logs.

3. Startup warning for open allow_from: all platforms now log a WARN-level
   message when allow_from is not configured, making it obvious that the
   deployment permits all users. This surfaces the fail-open default so
   operators can make an informed decision.

Ref #60
2026-03-12 06:09:28 +08:00
q107580018andmac 6bdecaad49 feat: support explicit batch session deletion (#74)
* feat: support batch session deletion

* feat(feishu): add card-based delete flow

* fix(feishu): report missing selected sessions

---------

Co-authored-by: mac <mac@Mac-mini.local>
2026-03-12 06:01:02 +08:00
q107580018andmac 986faefb4a feat(codex): support reasoning effort switching (#70)
* feat(codex): support reasoning effort switching

* fix(codex): remove unsupported minimal effort

---------

Co-authored-by: mac <mac@Mac-mini.local>
2026-03-11 19:38:00 +08:00
woqiqishi 13a750c1b5 feat(cards): interactive card UI for slash commands (Feishu) (#52)
* 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
2026-03-11 07:52:36 +08:00
bydsky 7ed5cff6b9 fix(skill): follow symbol link (#61) 2026-03-11 07:05:11 +08:00
chenhg5andClaude 1061d82be6 feat(bind): add setup command and system prompt support
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>
2026-03-09 21:22:54 +08:00
chenhg5andClaude 7ad7584583 fix(engine): prevent stale event processing in agent sessions
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>
2026-03-09 19:12:24 +08:00
chenhg5andClaude 3cbf69e1db feat(messaging): add message tracing and threaded replies
- Added MessageID field to Message struct for platform message tracing

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-09 18:08:15 +08:00
chenhg5andClaude 533dc7d84a feat(tts): improve TTS config handling and add mode validation
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>
2026-03-09 16:55:55 +08:00
wujian 6fddec105e tts:add tts test 2026-03-09 16:10:05 +08:00
wujian 0dc9168029 tts:fix some code review comments 2026-03-09 15:45:21 +08:00
oskarwu 27c8eccdbb feat: add TTS support with Qwen and OpenAI providers 2026-03-09 12:07:40 +08:00
cg33 7425bfbf67 Merge pull request #37 from kevinWangSheng/fix/permission-idle-timer
fix(engine): stop idle timer during permission wait
2026-03-09 09:24:01 +08:00
kevinWangSheng b3ddd1a0f5 fix(cron): log json.Unmarshal error instead of ignoring it
When the cron jobs file is corrupted, json.Unmarshal fails silently
and all scheduled tasks are lost without any log output. Add error
logging so the issue is visible in logs.
2026-03-08 17:30:14 -07:00
kevinWangSheng 4f74588429 fix(engine): stop idle timer during permission wait
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.
2026-03-08 17:29:09 -07:00
chenhg5andClaude 0b308fef3a feat(relay): add persistence and improve binding messages
Add data persistence to RelayManager with JSON storage.
Remove unused MsgRelayBindOK message.
Improve relay binding success messages.
Update RelayManager constructor to accept data directory path.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 21:51:04 +08:00
chenhg5andClaude 7d722d65a6 refactor(cmdCompress): improve compression command handling
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>
2026-03-08 21:34:53 +08:00
chenhg5andClaude 754c65af32 feat(i18n): add new message keys and improve command formatting
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>
2026-03-08 21:17:25 +08:00
chenhg5andClaude c70d3eed7e feat(iflow): update CLI flags and preserve quiet state
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>
2026-03-08 09:30:28 +08:00
chenhg5andClaude b14d34d7b2 feat(engine): add shell command execution capability
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>
2026-03-08 09:09:23 +08:00
cg33 f265e9e6cd Merge pull request #30 from marxoffice/main
feat(telegram): add bot command menu registration
2026-03-08 08:49:12 +08:00
cg33 7ceb4a7dbf Merge pull request #26 from xinyuan0801/codex/add-iflow-cli-agent-support
feat: add iFlow CLI agent support
2026-03-08 08:40:03 +08:00
Rayquaza 686ee0463c update(i18n): arg help info for /quiet 2026-03-08 01:27:12 +08:00
Rayquaza d4469bfafd Merge branch 'chenhg5:main' into main 2026-03-08 01:19:50 +08:00
Rayquaza 4e5d760bd2 feat(telegram): add bot command menu registration
- 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
2026-03-08 01:12:57 +08:00
cg33 82abdc0990 Merge pull request #19 from kevinWangSheng/fix/quiet-global-scope
fix: /quiet 改为全局作用域
2026-03-07 23:12:19 +08:00
chenhg5andClaude Opus 4.6 952a0e5d24 feat(relay): support multi-bot binding in group chats
- 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>
2026-03-07 18:49:23 +08:00
xinyuan0801 74b88bc352 feat: add iFlow CLI agent support 2026-03-07 10:26:44 +08:00
chenhg5andClaude f8e5e7b828 fix(streaming): clean stale previews when degraded
Add logic to delete stale preview messages when stream preview is degraded.
Implement PreviewCleaner interface for Telegram platform and add test coverage.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 09:02:19 +08:00
chenhg5andClaude 0179d098ce feat(commands): add interactive buttons for lang/model/mode commands
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 08:36:30 +08:00
chenhg5andClaude 8f630a0538 feat(commands): add support for exec commands with shell execution
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>
2026-03-07 07:55:24 +08:00
chenhg5andClaude 796526df50 feat(engine): add configurable agent idle timeout
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>
2026-03-07 00:21:40 +08:00
chenhg5andClaude 0c119d8682 refactor(engine): increase event idle timeout to 30 minutes
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>
2026-03-07 00:08:00 +08:00
kevinWangShengandClaude Opus 4.6 f97bf3dcc1 fix: /quiet 支持 per-session 和 global 两种模式
- /quiet:切换当前会话的静默模式,/new 后重置
- /quiet global:切换全局静默模式,跨会话生效,/new 不影响
- 事件处理时 global || session 任一为 true 即静默

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:36:51 -08:00
kevinWangShengandClaude Opus 4.6 c7d985edd9 fix: /quiet 改为全局作用域,不再跟随 session 重置
之前 quiet 绑定在 interactiveState 上,/new 或 /switch 会清掉 state 导致
quiet 被重置。用户开了静默模式换个 session 又要重新开一次,体验不好。

改为挂在 Engine 上,全局生效,/new /switch 不影响。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:35:59 -08:00
chenhg5 ddff00577b Merge branch 'main_bak' 2026-03-06 21:32:27 +08:00
chenhg5andClaude Opus 4.6 54ea246f60 feat(i18n): add translation for session switch success message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:34:13 +08:00
chenhg5andClaude Opus 4.6 16b028b098 feat(ui): improve status display and fix Feishu message formatting
- 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>
2026-03-06 20:31:37 +08:00
wujian ed4a49c8ae voice function support qwen mod 2026-03-06 19:31:06 +08:00
chenhg5andClaude Opus 4.6 2160090ec6 feat(streaming): add per-platform streaming preview control
Add disabled_platforms config option to disable streaming preview
for specific platforms (e.g. feishu) where it causes formatting issues.

- Add DisabledPlatforms field to StreamPreviewConfig and StreamPreviewCfg
- Check platform name against disabled list in canPreview()
- Allows pure text messages to use correct message type instead of cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:08:43 +08:00