Commit Graph
95 Commits
Author SHA1 Message Date
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
wujian 505bb43bf0 voice function support qwen mod 2026-03-06 19:03:05 +08:00
chenhg5andClaude 44c48de8f2 refactor(core): improve message splitting logic with boundary checks
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>
2026-03-06 17:52:23 +08:00
chenhg5andClaude 50ee383051 feat(engine): improve error handling for platform startups
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>
2026-03-06 17:07:20 +08:00
chenhg5andClaude 5befb5cc0e feat(search): add session search command with name/ID matching
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>
2026-03-06 16:39:06 +08:00
chenhg5andClaude b0aa286c03 feat(cmd): add pagination support for list command
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>
2026-03-06 16:19:00 +08:00
chenhg5andClaude 2a48df3224 fix(engine): add idle timeout for unresponsive agent sessions
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>
2026-03-06 16:07:56 +08:00
chenhg5andClaude 9c5b290eae refactor(streaming): remove maxChars check and improve preview cleanup
Remove intermediate maxChars throttling since we now always attempt final update regardless of length. Add cleanup when final update fails by attempting to delete stale preview message.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 15:37:57 +08:00
chenhg5andClaude 6717b3ef0b feat(core): add message deduplication by process start time
Added StartTime tracking and IsOldMessage check to prevent processing of messages from before process startup. Implemented checks across all platforms with platform-specific timestamp handling. Includes tests for new functionality.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 15:25:08 +08:00
chenhg5andClaude 802c694a92 feat(updater): improve update process with auto-restart and Gitee support
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>
2026-03-06 14:45:00 +08:00
chenhg5andClaude 89ef7a7259 feat(updater): add Windows support for self-update
Add zip archive extraction functionality to support auto-updates on Windows systems.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 14:09:27 +08:00
chenhg5andClaude fcc0da88e2 feat(cron): add silent mode for cron job notifications
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 14:00:12 +08:00
chenhg5andClaude aa4b9a495a feat(relay): add bot-to-bot relay functionality with CLI and API support
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>
2026-03-06 13:49:21 +08:00
chenhg5 53d5576b4b build: release v1.2.0-beta.5 — streaming preview, typing indicators, markdown rendering, rate limiting
Made-with: Cursor
2026-03-06 11:21:46 +08:00
chenhg5andClaude e40d033c3f feat(engine): enhance session switching and markdown conversion
- 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>
2026-03-06 10:30:29 +08:00
chenhg5andClaude Opus 4.6 b8e8316968 feat: add typing indicator and fix HTML escaping
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>
2026-03-06 09:42:14 +08:00
chenhg5andClaude Opus 4.6 4b26663fd5 feat: improve markdown rendering and streaming preview
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>
2026-03-06 09:14:50 +08:00
chenhg5andClaude Opus 4.6 e5d328d9d6 feat: add streaming preview and rate limiting support
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>
2026-03-06 07:02:37 +08:00
chenhg5andClaude Opus 4.6 00477f25a8 refactor(core): remove redundant fmt.Sprintf and add unit tests
- 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>
2026-03-05 20:56:38 +08:00
chenhg5andClaude f31b3dd9be fix(engine): improve graceful shutdown and context handling
Add proper platform shutdown sequence before engine cleanup and check for canceled context in message processing and session creation to prevent operations during shutdown. Also reordered error collection for logical shutdown sequence.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 17:54:39 +08:00
chenhg5andClaude b07b18e181 feat(engine): add project-level command disabling support
Implement disabled commands functionality for projects, including config parsing, engine integration, and i18n support. Allows disabling specific commands per-project via config.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 14:43:51 +08:00
chenhg5andClaude d6a3a2253e feat: add banned words filter functionality
Add banned words configuration and filtering logic to block messages containing prohibited content. Includes:
- Config file support for banned_words list
- Engine methods to set and check banned words
- Case-insensitive matching during message processing
- Localization support for blocked message response
- Documentation updates in config example

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:59:25 +08:00
chenhg5andClaude 0667e970bf feat(agent): add session deletion capability
Implement session deletion functionality across all agent implementations (claudecode, codex, cursor, gemini)
Add new /delete command with session lookup by ID/prefix
Add i18n support for delete-related messages
Update command help texts to include new delete command
Add SessionDeleter interface for agents supporting deletion
Implement core deletion logic with active session protection

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:53:43 +08:00