# 第三方声明

本插件包含来自以下项目的代码。

---

## dsh-channel-wechat

- **来源**：https://github.com/wangx-wx/dsh-channel-wechat
- **版本**：0.2.5
- **许可**：MIT
- **版权**：Copyright (c) 2026 wangx-wx

### 搬运范围

| 本插件文件 | 对应原文件 | 搬了什么 |
|---|---|---|
| `lib/protocol/api.js` | `src/wechat/api.ts` | URL 端点、请求头、`base_info`、错误分类、超时结构 |
| `lib/protocol/inbound.js` | `src/wechat/types.ts`、`src/wechat/inbound.ts` | item 判别值、正文提取、媒体标签、命令语法 |
| `lib/protocol/login.js` | `src/wechat/login-machine.ts` | 二维码获取、状态归约 |

### 未搬的部分（有意）

| 原文件 | 为什么没搬 |
|---|---|
| `src/bridge/peer-map.ts` | 里面 `listAccounts()[0]` 取最旧账号，正是本插件要修的问题 |
| `src/channel/channel.ts` 的事件路由 | 每个 `assistant/message` 都回微信，是「中途发送」的根源 |
| `src/channel/single-run.ts` 的 `runExclusive` | 无超时，是「卡死」的根源 |
| 所有空 `catch` | 静默失败，让问题无法定位 |

### 协议本身的来源

原项目声明其协议实现参考腾讯的 [`openclaw-weixin`](https://github.com/Tencent/openclaw-weixin)，
其 `src/wechat/types.ts` 注释写明：

> Adapted from @tencent-weixin/openclaw-weixin (MIT, Copyright (C) 2026 Tencent)

本插件通过 `dsh-channel-wechat` 间接继承这条来源链。

---

## qrcode-generator

- **来源**：https://github.com/kazuhikoarase/qrcode-generator
- **版本**：2.0.4
- **许可**：MIT
- **版权**：Copyright (c) 2009, 2016 Kazuhiko Arase

### 搬运范围

| 本插件文件 | 内容 |
|---|---|
| `lib/protocol/qrcode.js` | qrcode-generator 的全部编码逻辑，原样搬入 |

**为什么要 vendored 而不是引依赖**：这是纯算法，几十行对外接口，
自己重写等于重造轮子，而且二维码编码细节错一处就扫不出来。

**改动**：只把 `const qrcode` 改成导出，并补一个 `renderQrSvg`。

---

## MIT 许可全文

```
MIT License

Copyright (c) 2026 wangx-wx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
