Skip to content

Commit b14c2f8

Browse files
author
linyuan.yang
committed
迁移 helper
1 parent ba71e74 commit b14c2f8

46 files changed

Lines changed: 43 additions & 8334 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/release-helper.yml‎

Lines changed: 0 additions & 142 deletions
This file was deleted.

‎.vscode/launch.json‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@
5656
"cwd": "${workspaceFolder}/packages/cli",
5757
"skipFiles": ["<node_internals>/**"]
5858
},
59-
{
60-
"type": "node-terminal",
61-
"request": "launch",
62-
"name": "Launch helper",
63-
"command": "pnpm dev",
64-
"cwd": "${workspaceFolder}/packages/helper"
65-
},
6659
{
6760
"type": "node-terminal",
6861
"request": "launch",

‎package.json‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@
3535
"debug:app:ios": "pnpm run assets && pnpm --filter @sbot/app run ios:dev",
3636
"build:app:ios": "pnpm run build:deps && pnpm run assets && pnpm --filter @sbot/app run ios:build",
3737

38-
"debug:helper": "pnpm --filter @sbot/helper run dev",
39-
"build:helper:macos": "pnpm --filter @sbot/helper run macos:build",
40-
"build:helper:windows": "pnpm --filter @sbot/helper run windows:build",
41-
"build:helper:linux": "pnpm --filter @sbot/helper run linux:build",
42-
4338
"release:sbot": "node scripts/release.js sbot",
4439
"release:app": "node scripts/release.js app",
45-
"release:helper": "node scripts/release.js helper",
4640

4741
"debug:docs": "pnpm --filter sbot-docs run dev",
4842
"build:docs": "pnpm --filter sbot-docs run build",

‎packages/admin/src/views/chat/ChannelsView.vue‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ import SessionDataConfigEditor, { type DataConfigValue } from '@/components/Sess
1515
const { t } = useI18n()
1616
const { confirm } = useConfirm()
1717
18+
// Render a field description as a hint, turning explicit http(s) URLs into clickable links.
19+
// Escapes first, then only injects anchors for matched URLs — safe against HTML in descriptions.
20+
function linkifyHint(text: string): string {
21+
const esc = text
22+
.replace(/&/g, '&amp;')
23+
.replace(/</g, '&lt;')
24+
.replace(/>/g, '&gt;')
25+
.replace(/"/g, '&quot;')
26+
return esc.replace(
27+
/(https?:\/\/[^\s)),。、]+)/g,
28+
'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>',
29+
)
30+
}
31+
1832
interface PluginInfo {
1933
type: string
2034
label: string
@@ -876,7 +890,7 @@ async function refresh() {
876890
<span v-if="field.description && !actionState[key]?.qrUrl" class="qr-msg qr-msg-muted">{{ field.description }}</span>
877891
</div>
878892
</SFormItem>
879-
<SFormItem v-else :label="field.label + (field.required ? ' *' : '')" :hint="field.type === 'boolean' ? '' : field.description">
893+
<SFormItem v-else :label="field.label + (field.required ? ' *' : '')">
880894
<SSelect v-if="field.type === 'select'" v-model="form.config[key]">
881895
<option v-for="opt in field.options" :key="opt.value" :value="opt.value">{{ opt.label }}</option>
882896
</SSelect>
@@ -890,6 +904,9 @@ async function refresh() {
890904
<button type="button" class="apikey-toggle" @click="passwordVisible[key] = !passwordVisible[key]" :title="passwordVisible[key] ? t('common.hide') : t('common.show')">{{ passwordVisible[key] ? t('common.hide') : t('common.show') }}</button>
891905
</div>
892906
<SInput v-else v-model="form.config[key]" :placeholder="field.description || ''" />
907+
<template v-if="field.type !== 'boolean' && field.description" #hint>
908+
<span v-html="linkifyHint(field.description || '')"></span>
909+
</template>
893910
</SFormItem>
894911
</template>
895912
</SFormSection>

‎packages/channel.xiaoai/src/plugin.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const xiaoaiPlugin: ChannelPlugin = {
3535
type: ConfigFieldType.Select,
3636
required: true,
3737
default: XiaoaiAuthMode.PassToken,
38-
description: '推荐使用辅助工具导出的 passToken',
38+
description: '推荐使用 sbox 导出的 passToken,下载:https://github.com/while-coder/sbox/releases',
3939
options: [
4040
{ label: 'passToken(推荐)', value: XiaoaiAuthMode.PassToken },
4141
{ label: '密码', value: XiaoaiAuthMode.Password },
@@ -45,12 +45,12 @@ export const xiaoaiPlugin: ChannelPlugin = {
4545
label: '密码 / passToken',
4646
type: ConfigFieldType.Password,
4747
required: true,
48-
description: '按登录方式填写小米账号密码或辅助工具导出的 passToken',
48+
description: '按登录方式填写小米账号密码,或用 sbox 导出的 passToken',
4949
},
5050
loginDeviceId: {
5151
label: '登录设备 ID',
5252
type: ConfigFieldType.String,
53-
description: 'PassportSDK deviceId,由辅助工具一并导出;留空则随机生成',
53+
description: 'PassportSDK deviceId,由 sbox 一并导出;留空则随机生成',
5454
},
5555
deviceName: {
5656
label: '音箱名称',

‎packages/docs-site/guide/channels.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ Talk to your XiaoAi smart speaker as a sbot channel.
106106
| Field | Description |
107107
|-------|-------------|
108108
| 小米 ID | Your Mi account ID |
109-
| 登录方式 | `passToken` from the helper tool, or Mi account password |
109+
| 登录方式 | `passToken` (recommended, obtained via **sbox**), or Mi account password |
110110
| 密码 / passToken | The credential matching the selected login mode |
111-
| 登录设备 ID | Optional PassportSDK `deviceId` from the helper tool |
111+
| 登录设备 ID | Optional PassportSDK `deviceId`, obtained via **sbox** |
112112
| 音箱名称 | Target speaker name (matches a device in your Mi account) |
113113

114114
2. The bot logs in to Mi Cloud, listens for voice messages on the device, and replies via TTS through the speaker
115+
116+
::: tip Getting `passToken` and `deviceId` with sbox
117+
Mi accounts often reject server-side password login (risk control / 2FA), so the recommended path is to log in once with **sbox** — a desktop helper toolbox — and copy the credentials it extracts:
118+
119+
1. Download **sbox** from the [releases page](https://github.com/while-coder/sbox/releases/latest) and launch it.
120+
2. Open the **XiaoAI Login** tool and complete the Mi account login in the popup window.
121+
3. sbox lists your devices and shows the `passToken` and `deviceId` — copy them into the channel fields above.
122+
:::

‎packages/docs-site/zh/guide/channels.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,17 @@ OneBot 是 [NapCat](https://napneko.github.io/)、[Lagrange](https://lagrangedev
189189
| 字段 | 说明 |
190190
|-------|-------------|
191191
| 小米 ID | 小米账号 ID |
192-
| 密码 | 小米账号密码 |
192+
| 登录方式 | `passToken`(推荐,通过 **sbox** 获取),或小米账号密码 |
193+
| 密码 / passToken | 与所选登录方式对应的凭据 |
194+
| 登录设备 ID | 可选,PassportSDK 的 `deviceId`,通过 **sbox** 获取 |
193195
| 设备名称 | 目标设备名(需与账号下的设备一致) |
194196

195197
2. 机器人登录到小米云,监听设备上的语音消息,并通过音箱 TTS 回复
198+
199+
::: tip 通过 sbox 获取 `passToken` 与 `deviceId`
200+
小米账号在服务器上常因风控 / 二次验证导致密码登录失败,推荐用桌面工具箱 **sbox** 登录一次,再把它提取出的凭据填入上面的字段:
201+
202+
1. 从 [releases 页面](https://github.com/while-coder/sbox/releases/latest) 下载 **sbox** 并启动。
203+
2. 打开 **小爱登录** 工具,在弹出窗口中完成小米账号登录。
204+
3. sbox 会列出你的设备并显示 `passToken` 和 `deviceId`,复制填入上面的渠道字段即可。
205+
:::

‎packages/helper/.gitignore‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎packages/helper/CHANGELOG.md‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎packages/helper/index.html‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)