101 Commits

Author SHA1 Message Date
Mingkuan
e74be7a3f8 Release/1.7.1 (#247)
* feat: 添加审批功能(Inline Keyboard 按钮交互)

- 新增 approval-handler.ts:监听 Gateway 审批事件,发送带 Inline Keyboard 的审批消息
- api.ts:添加 sendC2CMessageWithInlineKeyboard / sendGroupMessageWithInlineKeyboard
- gateway.ts:处理 Inline Keyboard 按钮回调,注册/注销 approval-handler
- channel.ts:配置 execApprovals(3.28)和 approvals(3.31+)抑制框架 Forwarder 重复通知
- types.ts:添加 InlineKeyboard / KeyboardButton 等 Keyboard 类型定义
- openclaw-plugin-sdk.d.ts:补充 approval-runtime 模块声明

* feat: 增加outbound过滤

* feat: 新增审批相关配置

1. 斜杠指令当遇到报错的时候,支持将文本代理给模型来回复用户

* feat: 新增gateway审批路由注册

* feat: 新增gateway审批路由注册

* feat: 修复低版本发现的问题

1. 3.11版本兼容性处理,动态加载gateway依赖
2. 兼容3.28版本,声明审批功能可用
3. 恢复默认配置的文案修改

* feat: 修复gateway依赖加载失败问题

* feat: update 1.7.1 release
2026-04-03 03:12:30 +08:00
Mingkuan
2ea3dbf452 Release/1.7.0 (#243)
* feat: support raw msg ref

* fix: mention msg content

* fix: qqmedia tag

* feat: parse msgrefid

* feat: 流式消息能力增强、斜杠指令扩展与媒体标签处理优化

## 流式消息 (streaming)
- 支持流式消息引用:回复时携带引用消息 ID,通过 message_reference 字段传递
- 重构回复边界(reply boundary)机制:检测到模型返回新回复(文本前缀不匹配)时,
  不再终结当前会话并创建新 controller,改为在已有内容后拼接 "\n\n" 分隔符,
  在同一流式会话中继续发送,移除 onReplyBoundary 回调及 gateway 中的重建逻辑
- 移除遇到未闭合媒体标签时提前终结流式会话的逻辑,改为继续正常流式发送安全文本
  部分(performFlush 内置的 stripIncompleteMediaTag 已能保证安全),等待下次
  onPartialReply 带来更多文本后标签自然闭合
- 移除 sendStreamChunk / doStartStreaming 中冗余的 resp.code 错误检查
- streaming 阶段状态转换新增 idle 回退(首分片发送失败时可回退到 idle)
- sendC2CStreamMessage 返回类型从 StreamMessageResponse 统一为 MessageResponse;
  仅终结分片(DONE)触发 sendAndNotify 引用回调,中间分片直接调用 apiRequest
- 移除 types.ts 中不再使用的 StreamMessage / PendingReply 等冗余类型定义
- 补充 streaming-controller 测试用例:覆盖回复边界检测、多段拼接连续发送、
  sentIndex 连续性等场景

## 斜杠指令 (slash-commands)
- 新增 /bot-streaming on|off 指令,支持用户在私聊中查看和切换流式消息开关,
  修改后即时生效并持久化到 openclaw.json 配置文件
- 指令仅在 c2c(私聊)场景下可用,群聊场景下返回提示信息

## API 模块 (api)
- 引入 ApiLogger 接口与 setApiLogger 注入机制,将 api 模块内散落的
  console.log/error 调用统一替换为可注入的 log 实例,便于日志分级和集中管理
- gateway 启动时自动调用 setApiLogger 注入框架 log 实例
- startBackgroundTokenRefresh 中将参数名 log 改为 refreshLog,
  避免与模块级 log 变量冲突

## 网关 (gateway)
- 简化 StreamingController 创建流程:移除 createStreamingController 工厂函数
  及 onReplyBoundary 回调注册,直接内联创建 controller
- dispatch 失败时统一输出错误日志,包含是否收到过响应的信息

## 媒体标签处理 (media-send)
- 修复 splitMessageByMediaTags 中正则贪婪匹配导致的字符异常问题,
  改为非贪婪匹配避免跨标签吞并内容
- 新增代码块感知逻辑(isInsideCodeBlock):在匹配媒体标签前先识别并排除
  围栏代码块(```)区域,避免代码块中的标签被误当作媒体资源处理
- hasMediaTags / findFirstClosedMediaTag / splitByMediaTags 均集成代码块过滤
- findFirstClosedMediaTag 不再对 textBefore 做 trim 和多余换行合并处理
- 新增 code-block-media-tag 测试文件,覆盖代码块内标签忽略、混合内容拆分、
  嵌套代码块、未闭合代码块等边界场景

* ci: 添加插件测试环境流水线流程

* fix: 文件超2G错误信息优化

* fix: 优化文件上传兜底文案

* fix(api): 流式消息不存储引用,移除 DONE 分片的 sendAndNotify 回调

* feat: update ref struct

* fix(ref); 移除引用中暂时无用的赋值。

* feat: 支持自然语言更新版本

* feat(qqbot-upgrade): 声音qqbot-upgrade skill

* feat: 增加/bot-streaming不支持时的默认回复

* refactor: 重构升级脚本降级架构 v4 + 安全扫描绕过 + 内置插件禁用

## 降级架构重构
- 两级降级:Level 1 原生命令 → Level 2 npm pack + openclaw install 本地目录
- Level 1 去掉无效的多源重试(ClawHub 限流时换 npm 源无意义)
- Level 2 多源重试(npm pack 直接走 npm registry,真正绕过 ClawHub)

## 安全扫描绕过(openclaw ≥2026.3.30)
- ≥3.30 跳过 update 路径(update 不支持 --dangerously-force-unsafe-install)
- Level 2 传解压后的目录路径而非 tarball(绕过 installPluginFromArchive 漏传 flag 的 bug)
- 版本检测:仅 ≥3.30 时加 --dangerously-force-unsafe-install

## 内置插件冲突处理
- 默认禁用内置冲突插件(openclaw ≥2026.3.31 内置了 qqbot)
- 安装前清理历史遗留 ID(qqbot/openclaw-qq)的 entries/installs/allow
- 安装后验证内置插件确实已禁用

## 其它优化
- update 超时从 1000s 缩短至 180s(失败更快降级)
- install 前清除配置中的插件记录(避免 already exists)
- 精简告警信息:超时提示静默化,重试中间失败去掉 ⚠️
- 步骤标签对齐 [1/4]~[4/4]

* feat: inject OpenClaw version into User-Agent via runtime

- Add PluginRuntime.version field to openclaw-plugin-sdk.d.ts
- Replace static PLUGIN_USER_AGENT const with getPluginUserAgent() function
  so the OpenClaw version can be updated after runtime injection
- Add setOpenClawVersion() to api.ts for runtime to call
- Call setOpenClawVersion(runtime.version) in setQQBotRuntime()
- Update all PLUGIN_USER_AGENT usages to getPluginUserAgent()
- Fall back to OPENCLAW_VERSION / OPENCLAW_SERVICE_VERSION env vars
  before runtime is available

* fix: remove env-based OpenClaw version fallback

Reading version from process.env is a security risk as env vars
can be tampered. Use runtime.version exclusively; fall back to
"unknown" until runtime is injected.

* fix(upgrade): 切换 gateway.reload.mode=hot 防止安装期间配置写入触发 cgroup kill

问题根因:
- openclaw gateway restart 使用 systemctl --user restart
- systemd 默认 KillMode=control-group,重启时清理整个 cgroup
- 安装流程多次写 openclaw.json,hybrid 模式下触发 restart,脚本被杀

修复:
- snapshot_config 提前到所有写操作前(含 disable_builtin_plugins)
- 安装窗口开始时切换 gateway.reload.mode=hot(热更新不重启)
- 新增 restore_reload_mode():有原值 config set 恢复,无原值 config unset 删除
- cleanup_on_exit 和 [4/4] 前均调用恢复,正常/异常退出均兜底

* fix: 修复windows下路径编码异常导致文件发送错误的问题

* feat: add preferOver to disable built-in qqbot plugin

* feat: 插件升级skill优化

* feat: 更新skill的仓库名

* feat: update 1.7.0 changelog

* Merge branch 'feat/1.7.0-revertskill' into 'main' (merge request !44)

feat: revert qqbot-upgrade skill

---------

Co-authored-by: cxyhhhhh <chenxuyang.win@qq.com>
2026-04-02 16:51:19 +08:00
rianli
5ba2b706d6 docs: add note that v1.6.6 and below do not support /bot-upgrade hot update 2026-03-30 22:12:32 +08:00
rianli
8c8d30393f fix/upgrade-script-config-cleanup (merge request !27)
Squash merge branch 'fix/upgrade-script-config-cleanup' into 'main'
1. 升级脚本与热更指令稳定性优化 2.升级脚本性能优化 3.提醒功能多账户 Bug 修复
2026-03-30 12:28:03 +00:00
WideLee
eee4f15dd8 feat: update 1.6.6 changelog 2026-03-26 22:29:32 +08:00
rianli
6eb41cdf0e docs: update CHANGELOG 2026-03-26 19:08:44 +08:00
rianli
6fc9fb143d docs: update CHANGELOG for v1.6.5 OpenClaw 3.23 compat; remove upgrade-via-alt-pkg.sh 2026-03-24 15:56:22 +08:00
rianli
d71955f59c docs: add hot-update screenshot and Windows notice to README 2026-03-22 06:26:08 +08:00
WideLee
bfb4000508 docs: add Contributors and Acknowledgements sections to README 2026-03-22 03:08:12 +08:00
rianli
9361fe68cb chore: remove alpha version references from docs and help text 2026-03-22 03:00:09 +08:00
rianli
7190bc4b96 release: v1.6.4 — hot upgrade, channel API tool, credential backup, Windows PowerShell support 2026-03-21 01:50:54 +08:00
rianli
66d2e66cb0 chore: bump version to 1.6.3 - Update checker: HTTPS-native with multi-registry fallback - Upgrade script: multi-registry fallback (npmjs → npmmirror → default) - Update CHANGELOG, README, package.json 2026-03-18 15:45:23 +08:00
rianli
0cccbb39fc chore: rename slash command prefix /qqbot- to /bot- 2026-03-18 07:51:20 +08:00
rianli
3ea1223106 docs: update version to v1.6.1 in README 2026-03-18 00:50:48 +08:00
rianli
94e12b138c feat: v1.6.0 — 上线通知优化、斜杠指令体系完善、文档更新 2026-03-17 16:42:15 +08:00
rianli
e8cec91579 feat: v1.6.0 — 斜杠指令体系 / qqmedia统一标签 / token缓存优化 / 版本更新 2026-03-17 16:42:15 +08:00
rianli
a73b074a92 feat: v1.6.0 — 斜杠指令体系 + token缓存修复 + 版本更新 2026-03-16 22:57:33 +08:00
rianli
f3fa1b825c docs: rename image/voice section titles 2026-03-12 13:38:24 +08:00
rianli
5ec8a0e426 docs: add current version heading to READMEs 2026-03-12 13:28:49 +08:00
rianli
9d75efff54 docs: update version badge in README 2026-03-12 13:25:47 +08:00
rianli
fc3d0cffb8 docs: refine latest version note in README 2026-03-12 13:17:48 +08:00
rianli
bd1c68285a docs: add latest 1.5.7 note in README 2026-03-12 13:16:07 +08:00
rianli
cfd804adaa docs: add quoted-message screenshot to README 2026-03-12 12:53:53 +08:00
rianli
4860f49ccd docs: update README and changelog for quoted-message support 2026-03-12 12:37:04 +08:00
rianli
f56b3a4fe1 docs: refine upgrade guide links and wording 2026-03-11 19:49:27 +08:00
rianli
aee7cbf60d docs: refine upgrade guide links and wording 2026-03-11 16:46:14 +08:00
rianli
8efb9c07d9 docs: fix direct download link for npm upgrade script 2026-03-11 14:35:08 +08:00
rianli
fa93b2dd58 docs: clarify upgrade script usage and source-run constraints 2026-03-11 14:08:38 +08:00
rianli
a34b3800f1 chore: rename upgrade scripts and sync upgrade docs 2026-03-11 12:07:45 +08:00
rianli
d93b9c414c docs: update npm upgrade examples to stable 1.5.6 2026-03-10 23:39:50 +08:00
rianli
27c088e96d feat: add voice input source logging and scheduled reminder docs
- Add voice input summary log in gateway.ts with STT/ASR/fallback
  source counters and ASR text preview for debugging voice pipeline
- Add scheduled reminder (proactive message) section to README.md
  and README.zh.md with demo screenshot
2026-03-10 20:17:29 +08:00
rianli
9e401cf539 fix(qqbot): improve voice passthrough and appId compatibility
- forward voice attachments + asr_refer_text to OpenClaw with explicit fallback strategy

- update qqbot-media skill docs for STT-first handling and asr fallback

- normalize appId parsing across runtime and proactive scripts (supports numeric/string values)

- align proactive config loading and token cache key handling
2026-03-10 18:05:42 +08:00
rianli
9da6027965 feat: add npm-upgrade.sh for npm-based plugin installation
Supports installing from npm registry (latest/tag/version) or local tgz.
Handles config backup, old plugin cleanup, install, config restore and
gateway restart automatically.
2026-03-10 15:31:48 +08:00
rianli
819fb24813 docs: optimize README structure, simplify showcase and upgrade sections 2026-03-10 00:15:39 +08:00
rianli
86df52bcfa docs: merge media guide examples and images into README 2026-03-09 22:59:26 +08:00
rianli
7207129bc3 docs: rename version.md to CHANGELOG.md, add version dates and release notes
- Rename version.md to CHANGELOG.md (standard convention)
- Add 1.5.4/1.5.5 release notes
- Add release dates to all version entries
- Fix star-history URLs: openclaw-qq -> openclaw-qqbot
- upgrade-and-run.sh: show qqbot plugin version before/after upgrade
- upgrade-and-run.sh: fix node inline script encoding, increase prompt timeout to 30s
2026-03-09 22:11:17 +08:00
rianli
19a1b2081e fix: align package name with plugin manifest, fix normalizeTarget return type
- Revert package name to 'qqbot' to match openclaw.plugin.json manifest id
- Update repository URLs to tencent-connect/openclaw-qqbot
- Fix normalizeTarget to return structured {ok, to, error} object
- Update README repo badges and links
2026-03-09 21:35:53 +08:00
rianli
58d5f2c019 fix: resolve plugin id mismatch warning and log spam
- Rename package to @tencent-connect/qqbot to match manifest id, eliminating 'plugin id mismatch' warning
- Add explicit openclaw.id to clawdbot/moltbot/openclaw config sections
- Remove high-frequency debug logs in channel config callbacks (listAccountIds, resolveAccount, defaultAccountId)
- Add one-click install & run method using upgrade-and-run.sh to README
2026-03-09 20:33:55 +08:00
rianli
11b230a989 refactor: 整理脚本目录结构,兼容原仓库插件清理
- 脚本统一移入 scripts/ 目录(pull-latest.sh, upgrade-and-run.sh, set-markdown.sh)
- 删除不可用的 npm 版 scripts/pull-latest.sh,保留 git 版
- upgrade.sh / qqbot-cli.js 清理逻辑兼容原仓库 @sliverp/qqbot 和本仓库多种插件 ID
- 扩展目录查找兼容 extensions/qqbot 和 extensions/openclaw-qq
- 新增 moltbot 支持
- LICENSE 添加原作者 sliverp 版权声明
- 更新 README/docs 中脚本路径引用
- package.json files 字段增加 scripts 目录
2026-03-09 20:12:24 +08:00
rianli
efed32cf34 chore: migrate repo from sliverp/qqbot to tencent-connect/openclaw-qq
- Rename npm package from @sliverp/qqbot to @tencent-connect/openclaw-qq
- Update all GitHub URLs to tencent-connect/openclaw-qq
- Update Star History, badge links, git clone commands
- Update CLI help text and install commands in bin/qqbot-cli.js
- Update pull-latest.sh default repo URL and package name
- Update LICENSE copyright to Tencent Connect only
- Adjust README install/upgrade sections (npm package not yet published)
- Remove npm version badge temporarily until package is published
2026-03-09 19:56:06 +08:00
Bijin
78e38e11d1 Update README.md 2026-03-09 17:16:32 +08:00
Bijin
cfac070717 Update README.md 2026-03-08 22:34:37 +08:00
sliverp
2f8a1d1d5e docs: 添加 1.5.4 版本更新日志 2026-03-08 22:30:11 +08:00
sliverp
a5ba39ccfd docs: 添加多账户配置文档 2026-03-08 22:23:52 +08:00
sliverp
584bd188d5 chore(release): 发布版本 1.5.4 2026-03-08 21:00:45 +08:00
rianli
77c1761e8b refactor: pull-latest.sh 改为 Git 源码更新,优化交互提示
- pull-latest.sh 从 npm pack 方案重写为 Git 源码更新
- 本地修改使用 git stash 暂存而非丢弃,可通过 git stash pop 恢复
- README.md / README.zh.md 新增 upgrade-and-run.sh 和 pull-latest.sh 说明
- 删除过时的 README.bak.md
2026-03-07 05:19:50 +08:00
rianli
187de5c23d feat: make pull-latest.sh fully standalone and self-contained
- Remove dependency on script file location (zsh / dirname)
- Auto-locate plugin from ~/.{cli}/extensions/qqbot
- Support fresh install when no plugin found
- Use system tmpdir instead of project-relative tmp
- Fix 5a stage/restore to avoid deleting just-synced files
- Inline --help output (no longer reads zsh)
- Add src/utils/platform.ts and scripts/pull-latest.sh
2026-03-06 22:33:25 +08:00
rianli
b2f51e42e1 feat: enhance media handling with upload cache, video support, and retry
- Add upload-cache.ts: skip duplicate uploads via content hash (like Telegram file_id)
- Add media-tags.ts: auto-fix common LLM tag misspellings (qqimage->qqimg, etc.)
- Add file-utils.ts: async file I/O, size validation (20MB limit)
- Add <qqvideo> tag support for video messages
- Add upload retry with exponential backoff for network resilience
- Add file_name param to upload APIs for proper file naming
- Improve STT/TTS config with two-level fallback (channel -> framework)
- Optimize voice handling: prefer voice_wav_url, skip SILK->WAV when possible
- Filter large base64 from API logs; switch to async file I/O in outbound
- Update SKILL.md and README docs
2026-03-06 01:08:28 +08:00
Bijin
4fad4d854c Update README.md 2026-03-02 17:30:11 +08:00
Bijin
a92c8ed371 Update README.md 2026-02-27 16:34:18 +08:00