@michengai/dsh-im-connect 0.1.28 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/CHANGELOG.zh-CN.md +8 -0
- package/README.en.md +15 -10
- package/README.md +15 -10
- package/assets/screenshots/settings-channels.png +0 -0
- package/client.js +59 -44
- package/lib/client.js +59 -44
- package/lib/manager.d.ts +2 -0
- package/lib/manager.d.ts.map +1 -1
- package/lib/manager.js +7 -1
- package/lib/manager.js.map +1 -1
- package/package.json +1 -1
- package/src/manager.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
The five most recent published versions are listed below. Git tags and GitHub Releases now mirror these entries; historical sections retain links to their original release commits.
|
|
6
6
|
|
|
7
|
+
## 0.1.29 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- Completed Host-language localization across the multi-account settings flow, including account setup, selectors, status, actions, empty states, confirmations, and actionable server errors.
|
|
10
|
+
- Localized automatically generated account names without migrating stored account data, while preserving custom account names unchanged.
|
|
11
|
+
- Fixed narrow account inspectors so concise English connection actions remain aligned on one row, with whole-button wrapping as a safe fallback.
|
|
12
|
+
|
|
13
|
+
Published package: [`@michengai/dsh-im-connect@0.1.29`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.29).
|
|
14
|
+
|
|
7
15
|
## 0.1.28 — 2026-09-01
|
|
8
16
|
|
|
9
17
|
- Added multiple isolated accounts for WeChat, WeCom, QQ, DingTalk, Feishu, Lark, and Telegram, with independent workspace, model, permission, private-access, credential, allowlist, and session state.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录最近发布的五个版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
+
## 0.1.29 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- 补齐多账号设置全流程的宿主语言本地化,覆盖账号配置、选择器、状态、操作、空状态、确认提示与可执行的服务端错误。
|
|
10
|
+
- 自动生成的账号名现在会随宿主语言显示,无需迁移已有数据;自定义账号名保持原样。
|
|
11
|
+
- 修复狭窄账号详情栏的英文操作按钮布局:精简连接操作文案并保持单行对齐,极窄宽度下按整颗按钮换行。
|
|
12
|
+
|
|
13
|
+
发布包:[`@michengai/dsh-im-connect@0.1.29`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.29)。
|
|
14
|
+
|
|
7
15
|
## 0.1.28 — 2026-09-01
|
|
8
16
|
|
|
9
17
|
- 微信、企业微信、QQ、钉钉、飞书、Lark 与 Telegram 现可接入多个相互隔离的账号;每个账号独立保存工作区、模型、权限、私聊准入、凭据、白名单与会话状态。
|
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
**Connect Feishu, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
9
|
+
**Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[简体中文](README.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
25
|
- Connect DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram from **Settings → IM Assistant**.
|
|
26
|
+
- Add multiple accounts under the same channel. Each account has its own workspace, model, reasoning effort, permission, private-access mode, credentials, allowlist, and session state.
|
|
26
27
|
- Each IM chat maps to an independent DSH session under the workspace **Channels** tab, never mixed into web **Tasks**.
|
|
27
|
-
- Send work
|
|
28
|
+
- Send work and read replies from the phone. When DSH needs input, handle tool approval or denial, single choice, multiple choice, and custom answers in the originating IM conversation.
|
|
28
29
|
- Bind by QR code or credentials. Secrets go into DSH `ctx.credentials`, not `channels.json`.
|
|
29
30
|
- Paste one sentence into DSH, Codex, or WorkBuddy and let that agent install the plugin locally.
|
|
30
31
|
- Groups need no binding, only a mention. In DMs, QR scanners are auto-allowed only when the platform returns their identity; everyone else must be approved on the settings page.
|
|
@@ -44,6 +45,7 @@ Inbound messages are identified before commands, tool approvals, or injection.
|
|
|
44
45
|
| DM after manual credentials | Telegram, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
|
|
45
46
|
| DM without a userId | Denied |
|
|
46
47
|
| Tool approval | Only an allowlisted user in a DM can reply `Approve` / `Deny` (or `批准` / `拒绝`); group replies do not grant |
|
|
48
|
+
| Interactive choice | Reply with an option number or text in the originating IM conversation; separate multiple choices with commas or add a custom answer; only the initiating user can answer in a group |
|
|
47
49
|
|
|
48
50
|
WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk immediately. A different WeChat account DMing the bot waits for settings approval.
|
|
49
51
|
|
|
@@ -73,7 +75,7 @@ WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk
|
|
|
73
75
|
|
|
74
76
|
## Screenshots
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
Add accounts under each channel in **Settings → IM Assistant**. Expand a channel, select an account, and configure its workspace, model, permission, private access, and receive state independently on the right:
|
|
77
79
|
|
|
78
80
|

|
|
79
81
|
|
|
@@ -162,7 +164,7 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
|
|
|
162
164
|
dsh --profile web --dump-config
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
To pin a release, replace `@latest` with a version such as `@0.1.
|
|
167
|
+
To pin a release, replace `@latest` with a version such as `@0.1.28`.
|
|
166
168
|
|
|
167
169
|
The configuration output should contain `im-connect`. Restart DSH Web and hard-refresh the browser. Do not copy client files manually: `dsh plugin add` also applies `cordis.patch.yml`.
|
|
168
170
|
|
|
@@ -186,17 +188,19 @@ Restart DSH Web and hard-refresh the browser. `dsh plugin ... add .` reads the p
|
|
|
186
188
|
|
|
187
189
|
## Usage
|
|
188
190
|
|
|
189
|
-
Open **Settings → IM Assistant**,
|
|
191
|
+
Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, and private-access mode. The full guide is [Usage guide](docs/02-产品与业务/04-使用说明.md).
|
|
190
192
|
|
|
191
193
|
| Goal | Action | Notes |
|
|
192
194
|
| --- | --- | --- |
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
+
| Add an account | Select **Add account** under a channel, choose the account settings, then scan or enter credentials | The same channel can contain multiple accounts; Feishu / Lark / WeChat are QR-only, while Telegram needs a Bot Token |
|
|
196
|
+
| Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, or private-access mode on the right | Changes affect only that account and apply to its subsequent sessions immediately |
|
|
197
|
+
| Pause receiving | Select the account and turn off **Receive messages** on the right | Credentials and settings stay; only new inbound messages for that account pause |
|
|
195
198
|
| Send work from IM | WeChat / Feishu / Lark / QQ QR scanners can DM immediately; DingTalk / WeCom scanners and other users need approval. Groups only need a mention | Each chat has its own channel session |
|
|
196
199
|
| Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
|
|
197
200
|
| Start a new session | Send `/new` or `/clear` | Affects only the current IM chat |
|
|
198
201
|
| Status / help | Send `/status` or `/help` | Scoped to the current channel session |
|
|
199
202
|
| Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
|
|
203
|
+
| Answer an interactive question | Reply with an option number or text; separate multiple choices with commas, or enter a custom answer | Multiple questions arrive in order; only the initiating user can answer in a group |
|
|
200
204
|
| Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
|
|
201
205
|
| Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
|
|
202
206
|
|
|
@@ -206,13 +210,14 @@ DingTalk replies prefer official AI Card streaming and fall back to plain text.
|
|
|
206
210
|
|
|
207
211
|
| Item | Current behavior |
|
|
208
212
|
| --- | --- |
|
|
209
|
-
| Access | Groups need no binding, only a mention.
|
|
213
|
+
| Access | Groups need no binding, only a mention. Each account can allow only approved users or all DM users; approved-only is the default, and WeChat / Feishu / Lark / QQ QR scanners are added to that account's allowlist automatically |
|
|
210
214
|
| Management API | Enforces both a loopback peer and loopback host (`localhost`, `127.0.0.1`, `[::1]`); mutations require JSON and the plugin client header |
|
|
211
215
|
| Secrets | WeChat tokens and other secrets prefer DSH `ctx.credentials`; otherwise they use plaintext `%DSH_HOME%\dsh-im-connect\secrets.json`, restricted to the current user and never safe to sync or share |
|
|
212
|
-
|
|
|
216
|
+
| Account state | `channels.json` stores per-account workspace, model, permission, private access, enablement, and credential refs, not raw secrets |
|
|
213
217
|
| Browser payloads | Never include tokens, secrets, App Secrets, or internal error details |
|
|
214
218
|
| WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
|
|
215
|
-
| Tool approval | Only
|
|
219
|
+
| Tool approval | Only a user on the current account's allowlist can grant or deny in a DM. Even when all DM users may chat, unapproved users cannot approve tools; approvals cannot cross conversations or come from groups |
|
|
220
|
+
| Interactive questions | Single-choice, multiple-choice, and custom questions return to the originating IM conversation; one conversation handles them in order, and only the initiating user can answer in a group |
|
|
216
221
|
|
|
217
222
|
Do not expose DSH Web beyond this machine. Permission presets use the same host sandbox-policy values as Chat; `danger-full-access` does not wrap a sandbox.
|
|
218
223
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram 接到本机 DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[English](README.en.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
## 功能概览
|
|
24
24
|
|
|
25
25
|
- 在「设置 → IM助理」里连接钉钉、飞书、Lark、微信、企业微信、QQ、Telegram。
|
|
26
|
+
- 同一渠道可添加多个账号;每个账号独立选择工作区、模型、推理强度、权限和私聊准入,凭据、白名单与会话状态也按账号隔离。
|
|
26
27
|
- 每个 IM 聊天对应一条独立 DSH 会话,出现在工作区「频道」,不会混进网页「任务」。
|
|
27
|
-
-
|
|
28
|
+
- 手机里直接下任务、看回复;DSH 发起交互时,可在原 IM 会话完成工具批准 / 拒绝、单选、多选和自定义回答。
|
|
28
29
|
- 支持扫码绑定或手动填凭据;敏感字段写入 DSH `ctx.credentials`,不会进 `channels.json`。
|
|
29
30
|
- 可把一句话复制到 DSH、Codex 或 WorkBuddy,让对方代装到本机 DSH。
|
|
30
31
|
- 群聊不用绑定,@ 即可对话;私聊中,平台能返回身份的扫码用户自动放行,其他人要在设置页批准。
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
| 私聊 · 手动凭据 | Telegram,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
|
|
45
46
|
| 私聊缺少 userId | 拒绝 |
|
|
46
47
|
| 工具审批 | 仅白名单用户在私聊回复「批准 / 拒绝」有效;群聊里回不算 |
|
|
48
|
+
| 交互选择 | 在原 IM 会话回复选项序号或文字;多选用逗号分隔,也可补充自定义答案;群聊只接受任务发起者回答 |
|
|
47
49
|
|
|
48
50
|
微信是扫码渠道且只支持私聊,所以连上后用**同一个微信号**即可直接用。换一个微信号私聊,会出现在设置页待批准。
|
|
49
51
|
|
|
@@ -73,7 +75,7 @@
|
|
|
73
75
|
|
|
74
76
|
## 界面预览
|
|
75
77
|
|
|
76
|
-
在「设置 → IM
|
|
78
|
+
在「设置 → IM助理」按渠道添加账号。展开渠道后选择账号,在右侧独立配置工作区、模型、权限、私聊准入和接收状态:
|
|
77
79
|
|
|
78
80
|

|
|
79
81
|
|
|
@@ -162,7 +164,7 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
|
|
|
162
164
|
dsh --profile web --dump-config
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.
|
|
167
|
+
需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.28`。
|
|
166
168
|
|
|
167
169
|
配置输出中应包含 `im-connect`。安装后重启 DSH Web 并在浏览器硬刷新。不要手工复制客户端文件,`dsh plugin add` 会同时应用 `cordis.patch.yml`。
|
|
168
170
|
|
|
@@ -186,17 +188,19 @@ dsh --profile web --dump-config
|
|
|
186
188
|
|
|
187
189
|
## 使用
|
|
188
190
|
|
|
189
|
-
打开「设置 → IM
|
|
191
|
+
打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限和私聊准入。详细步骤见 [使用说明](docs/02-产品与业务/04-使用说明.md)。
|
|
190
192
|
|
|
191
193
|
| 目标 | 操作 | 说明 |
|
|
192
194
|
| --- | --- | --- |
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
+
| 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 仅填 Bot Token |
|
|
196
|
+
| 修改账号配置 | 展开渠道并选择账号,在右侧修改工作区、模型、推理强度、权限或私聊准入 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
|
|
197
|
+
| 暂停接收 | 选择账号,关闭右侧「接收消息」 | 凭据和账号配置保留,只暂停该账号接收新消息 |
|
|
195
198
|
| 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
|
|
196
199
|
| 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
|
|
197
200
|
| 新开会话 | 发送 `/new` 或 `/clear` | 只影响当前 IM 聊天,不影响网页任务 |
|
|
198
201
|
| 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 只作用于当前频道会话 |
|
|
199
202
|
| 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
|
|
203
|
+
| 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
|
|
200
204
|
| 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
|
|
201
205
|
| 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
|
|
202
206
|
|
|
@@ -206,13 +210,14 @@ dsh --profile web --dump-config
|
|
|
206
210
|
|
|
207
211
|
| 项 | 当前行为 |
|
|
208
212
|
| --- | --- |
|
|
209
|
-
| 用户准入 | 群聊不用绑定,只需
|
|
213
|
+
| 用户准入 | 群聊不用绑定,只需 @。每个账号可选择「仅已批准用户」或「允许所有私聊用户」;默认仅批准用户可用,微信 / 飞书 / Lark / QQ 扫码者会自动加入该账号白名单 |
|
|
210
214
|
| 管理接口 | 强制校验本机回环来源及 Host(`localhost` / `127.0.0.1` / `[::1]`);写接口要求 JSON 和插件客户端请求头 |
|
|
211
215
|
| 敏感字段 | 包括微信 token 在内均优先写入 DSH `ctx.credentials`;没有该服务时落到 `%DSH_HOME%\dsh-im-connect\secrets.json`(明文,仅限当前用户,禁止同步或分享) |
|
|
212
|
-
|
|
|
216
|
+
| 账号状态 | `channels.json` 按账号保存工作区、模型、权限、私聊准入、启用状态和凭据引用,不保存明文 Secret |
|
|
213
217
|
| 浏览器回包 | 不返回 token、secret、App Secret 或内部异常详情 |
|
|
214
218
|
| 微信协议 | 只走腾讯官方 iLink,不使用逆向个人微信协议 |
|
|
215
|
-
| 工具批准 |
|
|
219
|
+
| 工具批准 | 仅私聊且发送者已在当前账号白名单时生效;即使账号允许所有私聊用户,未批准用户也不能审批工具,且不能跨会话或在群里批准 |
|
|
220
|
+
| 交互问题 | 单选、多选和自定义问题回到发起任务的 IM 会话;同一会话按顺序处理,群聊只接受任务发起者回答 |
|
|
216
221
|
|
|
217
222
|
不要把 DSH Web 暴露到非本机地址。权限预设与 Chat 使用相同的 Host sandbox-policy;`danger-full-access` 不套沙箱。
|
|
218
223
|
|
|
Binary file
|
package/client.js
CHANGED
|
@@ -18,35 +18,41 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
const IM_LOCALE_NS = "im-connect";
|
|
19
19
|
const IM_LOCALES = {
|
|
20
20
|
zh: {
|
|
21
|
-
"settings.label": "IM助理", "settings.title": "IM
|
|
21
|
+
"settings.label": "IM助理", "settings.title": "IM机器人", "settings.description": "管理各渠道账号。每个账号独立选择工作区、模型和权限,配置仅保存在本机。",
|
|
22
22
|
"settings.aria": "IM助理", "settings.selectAccountTitle": "选择一个账号", "settings.selectAccountDescription": "从左侧选择账号,查看并修改工作区、模型和权限配置。", "settings.noAccountsTitle": "还没有接入账号", "settings.noAccountsDescription": "请在左侧选择对应渠道,然后点击“添加账号”。", "settings.publicChatNotice": "未批准用户可以发起聊天,但不能批准工具调用。", "pending.notice": "有访问请求。批准后该用户才能驱动本机助手。", "action.approve": "批准", "action.deny": "拒绝", "loading": "加载中…",
|
|
23
|
+
"account.workspace": "工作区", "account.currentWorkspace": "当前工作区", "account.selectWorkspace": "请选择工作区", "account.selectModel": "请选择模型", "account.selectPermission": "请选择权限", "account.privateAccess": "私聊准入", "account.privateApproved": "仅已批准用户", "account.privateAll": "允许所有私聊用户", "account.autoNameNote": "绑定成功后会自动生成账号名,无需手动填写。", "account.defaultName": "{channel}账号 {count}",
|
|
24
|
+
"account.countZero": "0 个账号", "account.countOnline": "{online} / {total} 在线", "account.countOffline": "{total} / {total} 离线", "account.statusProcessing": "处理中…", "account.statusOnline": "在线", "account.statusOffline": "离线", "account.statusRunning": "运行正常", "account.statusNotConnected": "未连接", "account.receive": "接收消息", "account.receiveDescription": "关闭后保留账号配置,但不接收新消息", "account.removeConfirm": "确定移除这个账号?本机保存的配置和凭据将一并删除。",
|
|
25
|
+
"action.addAccount": "添加账号", "action.generateQr": "生成二维码", "action.checkConnection": "检查连接", "action.reconnectAccount": "重新连接", "action.removeAccount": "移除接入", "status.saving": "保存中…", "status.saved": "已保存",
|
|
23
26
|
"channel.dingtalk": "钉钉", "channel.feishu": "飞书", "channel.lark": "Lark", "channel.weixin": "微信", "channel.wecom": "企业微信", "channel.qq": "QQ", "channel.telegram": "Telegram",
|
|
24
27
|
"field.dingtalk.clientId": "Client ID(原 AppKey)", "field.dingtalk.clientSecret": "Client Secret(原 AppSecret)",
|
|
25
28
|
"bind.title": "配置 {channel}", "bind.close": "关闭", "bind.quick": "快捷绑定(推荐)", "bind.manual": "手动配置", "bind.success": "绑定成功,频道已连接", "bind.newIdentity": "检测到新的账号身份,已创建新账号", "bind.qrAlt": "{channel} 绑定二维码", "bind.generating": "正在生成…", "bind.expire": "二维码 {time} 后过期", "bind.scanned": "已扫码,请在手机上确认", "bind.retry": "请重新生成二维码", "bind.refresh": "重新生成二维码", "action.saving": "保存中…", "action.confirm": "确认",
|
|
26
29
|
"qr.weixin": "请使用微信扫描二维码完成绑定", "qr.feishu": "请使用飞书扫描二维码,将自动创建机器人", "qr.lark": "请使用 Lark 扫描二维码完成配对", "qr.wecom": "请使用企业微信扫描二维码,快捷绑定机器人", "qr.dingtalk": "请使用钉钉扫描二维码,自动创建机器人", "qr.qq": "请使用手机 QQ 扫描二维码,创建开放平台机器人", "qr.default": "请使用对应 App 扫描二维码",
|
|
27
30
|
"status.unconfigured": "未配置", "status.connected": "已连接", "status.connecting": "接入中…", "action.configure": "配置", "action.more": "{channel} 更多", "action.reconnect": "重新接入", "action.disconnect": "断开", "action.removeConfig": "删除配置", "action.receive": "接收消息",
|
|
28
|
-
"error.loadAssistant": "
|
|
31
|
+
"error.loadAssistant": "无法加载账号配置", "error.noModels": "当前 Host 还没有可用模型,请先在网页里配置提供商", "error.save": "保存失败", "error.chooseWorkspace": "请选择工作区目录", "error.workspaceUnavailable": "当前 Host 无法新增工作区", "error.addWorkspace": "新增工作区失败", "error.load": "加载失败", "error.connection": "无法连接本机 IM 助理接口", "error.request": "请求失败", "error.action": "操作失败", "error.qr": "无法生成二维码", "error.detailsInLog": "操作失败,请查看服务器日志。",
|
|
29
32
|
"composer.aria": "全局会话配置", "composer.project": "选择项目", "composer.projectAria": "项目", "composer.noWorkspaces": "暂无工作区", "composer.addWorkspace": "添加工作区…", "composer.permission": "权限", "composer.noModels": "暂无模型", "composer.workspacePath": "工作区路径", "action.cancel": "取消", "action.adding": "添加中…",
|
|
30
33
|
"permission.readOnly": "只读", "permission.workspaceWrite": "工作区写入", "permission.fullAccess": "完全访问",
|
|
31
34
|
"rail.workspace": "工作区", "rail.search": "搜索", "rail.searchPlaceholder": "搜索会话...", "rail.clearSearch": "清除搜索", "rail.filter": "筛选", "rail.group": "分组方式", "rail.byWorkspace": "按工作区", "rail.list": "单列表", "rail.sort": "排序方式", "rail.manual": "手动排序", "rail.recent": "最近更新", "rail.running": "运行中", "rail.idle": "空闲", "rail.renameAria": "重命名会话", "rail.rename": "重命名", "rail.fork": "分叉会话", "rail.archive": "归档会话", "rail.empty": "还没有频道会话。先在设置 → IM助理 里连接渠道,并给机器人发一条消息。", "rail.noTasks": "暂无网页任务", "rail.ungrouped": "未分组", "rail.tabsAria": "工作区分类", "rail.tasks": "任务", "rail.channels": "频道",
|
|
32
35
|
"time.now": "刚刚", "time.minutes": "{count}分钟前", "time.hours": "{count}小时前", "time.days": "{count}天前",
|
|
33
|
-
"server.unknownChannel": "未知渠道", "server.channelUnconfigured": "渠道未配置", "server.sessionMissing": "会话不存在", "server.qrUnsupported": "该渠道不支持扫码绑定", "server.qrExpired": "二维码已过期", "server.qrIncomplete": "扫码未完成", "server.accessDenied": "未授权:请管理员在设置 → IM助理 中批准你的访问。",
|
|
36
|
+
"server.unknownChannel": "未知渠道", "server.channelUnconfigured": "渠道未配置", "server.sessionMissing": "会话不存在", "server.accountMissing": "账号不存在", "server.accountConnectFailed": "账号连接失败,请查看本机日志", "server.accountReconnectFailed": "重新连接失败,请查看本机日志", "server.selectAccountSettings": "请选择提供商、模型、工作区或权限", "server.selectModel": "请选择提供商和模型", "server.selectWorkspace": "请选择工作区", "server.selectPermission": "请选择权限", "server.missingCredentials": "凭据不足,无法启动渠道", "server.qrUnsupported": "该渠道不支持扫码绑定", "server.qrExpired": "二维码已过期", "server.qrIncomplete": "扫码未完成", "server.accessDenied": "未授权:请管理员在设置 → IM助理 中批准你的访问。",
|
|
34
37
|
"status.disconnected": "已断开", "status.reconnectFailed": "重连失败", "status.connectingSocket": "连接中", "status.waitHandshake": "等待网关握手", "status.authenticating": "鉴权中", "status.reconnecting": "重连中", "status.connectionError": "连接错误", "status.connectionFailed": "连接失败", "status.streamConnected": "Stream 已连接", "status.stopped": "已停止", "status.longConnection": "长连接已建立", "status.polling": "轮询中", "status.notLoggedIn": "未登录", "status.waitQr": "等待扫码", "status.loggedIn": "已登录", "status.loggedInRecovered": "已登录(自动恢复)", "status.loggingIn": "登录中",
|
|
35
38
|
},
|
|
36
39
|
en: {
|
|
37
|
-
"settings.label": "IM Assistant", "settings.title": "IM
|
|
40
|
+
"settings.label": "IM Assistant", "settings.title": "IM Bots", "settings.description": "Manage accounts across channels. Each account has its own workspace, model, and permission settings, stored only on this machine.",
|
|
38
41
|
"settings.aria": "IM Assistant", "settings.selectAccountTitle": "Select an account", "settings.selectAccountDescription": "Choose an account on the left to view and edit its workspace, model, and permissions.", "settings.noAccountsTitle": "No accounts connected", "settings.noAccountsDescription": "Choose a channel on the left, then select Add account.", "settings.publicChatNotice": "Unapproved users can start chats, but they cannot approve tool calls.", "pending.notice": "There are access requests. Approve a user before they can control the local assistant.", "action.approve": "Approve", "action.deny": "Deny", "loading": "Loading…",
|
|
42
|
+
"account.workspace": "Workspace", "account.currentWorkspace": "Current workspace", "account.selectWorkspace": "Select a workspace", "account.selectModel": "Select a model", "account.selectPermission": "Select a permission", "account.privateAccess": "Private chat access", "account.privateApproved": "Approved users only", "account.privateAll": "Allow all DM users", "account.autoNameNote": "The account name is generated automatically after setup.", "account.defaultName": "{channel} account {count}",
|
|
43
|
+
"account.countZero": "0 accounts", "account.countOnline": "{online} / {total} online", "account.countOffline": "{total} / {total} offline", "account.statusProcessing": "Processing…", "account.statusOnline": "Online", "account.statusOffline": "Offline", "account.statusRunning": "Running normally", "account.statusNotConnected": "Not connected", "account.receive": "Receive messages", "account.receiveDescription": "Turn this off to keep the account settings without receiving new messages", "account.removeConfirm": "Remove this account? Its saved settings and credentials will also be deleted.",
|
|
44
|
+
"action.addAccount": "Add account", "action.generateQr": "Generate QR code", "action.checkConnection": "Check", "action.reconnectAccount": "Reconnect", "action.removeAccount": "Remove", "status.saving": "Saving…", "status.saved": "Saved",
|
|
39
45
|
"channel.dingtalk": "DingTalk", "channel.feishu": "Feishu", "channel.lark": "Lark", "channel.weixin": "WeChat", "channel.wecom": "WeCom", "channel.qq": "QQ", "channel.telegram": "Telegram",
|
|
40
46
|
"field.dingtalk.clientId": "Client ID (formerly AppKey)", "field.dingtalk.clientSecret": "Client Secret (formerly AppSecret)",
|
|
41
47
|
"bind.title": "Set up {channel}", "bind.close": "Close", "bind.quick": "Quick setup (recommended)", "bind.manual": "Manual setup", "bind.success": "Connected successfully", "bind.newIdentity": "A new account identity was detected and a new account was created", "bind.qrAlt": "{channel} setup QR code", "bind.generating": "Generating…", "bind.expire": "QR code expires in {time}", "bind.scanned": "Scanned. Confirm on your phone.", "bind.retry": "Generate a new QR code", "bind.refresh": "Generate a new QR code", "action.saving": "Saving…", "action.confirm": "Confirm",
|
|
42
48
|
"qr.weixin": "Scan the QR code with WeChat to connect", "qr.feishu": "Scan with Feishu; a bot will be created automatically", "qr.lark": "Scan with Lark to pair", "qr.wecom": "Scan with WeCom to quickly connect a bot", "qr.dingtalk": "Scan with DingTalk; a bot will be created automatically", "qr.qq": "Scan with mobile QQ to create an Open Platform bot", "qr.default": "Scan the QR code with the corresponding app",
|
|
43
49
|
"status.unconfigured": "Not configured", "status.connected": "Connected", "status.connecting": "Connecting…", "action.configure": "Configure", "action.more": "More options for {channel}", "action.reconnect": "Reconnect", "action.disconnect": "Disconnect", "action.removeConfig": "Remove configuration", "action.receive": "Receive messages",
|
|
44
|
-
"error.loadAssistant": "Could not load
|
|
50
|
+
"error.loadAssistant": "Could not load account settings", "error.noModels": "No models are available in the Host. Configure a provider in the web app first.", "error.save": "Could not save", "error.chooseWorkspace": "Choose a workspace directory", "error.workspaceUnavailable": "This Host cannot create workspaces", "error.addWorkspace": "Could not add workspace", "error.load": "Could not load", "error.connection": "Could not connect to the local IM Assistant API", "error.request": "Request failed", "error.action": "Action failed", "error.qr": "Could not generate a QR code", "error.detailsInLog": "The operation failed. Check the server logs for details.",
|
|
45
51
|
"composer.aria": "Global session settings", "composer.project": "Select project", "composer.projectAria": "Project", "composer.noWorkspaces": "No workspaces", "composer.addWorkspace": "Add workspace…", "composer.permission": "Permission", "composer.noModels": "No models", "composer.workspacePath": "Workspace path", "action.cancel": "Cancel", "action.adding": "Adding…",
|
|
46
52
|
"permission.readOnly": "Read Only", "permission.workspaceWrite": "Workspace Write", "permission.fullAccess": "Full access",
|
|
47
53
|
"rail.workspace": "Workspaces", "rail.search": "Search", "rail.searchPlaceholder": "Search sessions...", "rail.clearSearch": "Clear search", "rail.filter": "Filter", "rail.group": "Group by", "rail.byWorkspace": "By workspace", "rail.list": "Single list", "rail.sort": "Sort by", "rail.manual": "Manual", "rail.recent": "Recently updated", "rail.running": "Running", "rail.idle": "Idle", "rail.renameAria": "Rename session", "rail.rename": "Rename", "rail.fork": "Fork session", "rail.archive": "Archive session", "rail.empty": "No channel sessions yet. Connect a channel in Settings → IM Assistant, then send the bot a message.", "rail.noTasks": "No web tasks", "rail.ungrouped": "Ungrouped", "rail.tabsAria": "Workspace categories", "rail.tasks": "Tasks", "rail.channels": "Channels",
|
|
48
54
|
"time.now": "Just now", "time.minutes": "{count} min ago", "time.hours": "{count} hr ago", "time.days": "{count} days ago",
|
|
49
|
-
"server.unknownChannel": "Unknown channel", "server.channelUnconfigured": "Channel is not configured", "server.sessionMissing": "Session does not exist", "server.qrUnsupported": "This channel does not support QR setup", "server.qrExpired": "QR code has expired", "server.qrIncomplete": "QR setup was not completed", "server.accessDenied": "Access denied: ask an administrator to approve you in Settings → IM Assistant.",
|
|
55
|
+
"server.unknownChannel": "Unknown channel", "server.channelUnconfigured": "Channel is not configured", "server.sessionMissing": "Session does not exist", "server.accountMissing": "Account does not exist", "server.accountConnectFailed": "Could not connect the account. Check the local logs.", "server.accountReconnectFailed": "Could not reconnect the account. Check the local logs.", "server.selectAccountSettings": "Select a provider, model, workspace, or permission setting", "server.selectModel": "Select a provider and model", "server.selectWorkspace": "Select a workspace", "server.selectPermission": "Select a permission", "server.missingCredentials": "The channel cannot start because credentials are missing", "server.qrUnsupported": "This channel does not support QR setup", "server.qrExpired": "QR code has expired", "server.qrIncomplete": "QR setup was not completed", "server.accessDenied": "Access denied: ask an administrator to approve you in Settings → IM Assistant.",
|
|
50
56
|
"status.disconnected": "Disconnected", "status.reconnectFailed": "Reconnect failed", "status.connectingSocket": "Connecting", "status.waitHandshake": "Waiting for gateway handshake", "status.authenticating": "Authenticating", "status.reconnecting": "Reconnecting", "status.connectionError": "Connection error", "status.connectionFailed": "Connection failed", "status.streamConnected": "Stream connected", "status.stopped": "Stopped", "status.longConnection": "Long connection established", "status.polling": "Polling", "status.notLoggedIn": "Not signed in", "status.waitQr": "Waiting for scan", "status.loggedIn": "Signed in", "status.loggedInRecovered": "Signed in (restored)", "status.loggingIn": "Signing in",
|
|
51
57
|
},
|
|
52
58
|
};
|
|
@@ -190,7 +196,7 @@ window.__ModuleLoader__.load({
|
|
|
190
196
|
.ima-inspector{padding:22px 24px 26px;min-width:0}.ima-inspector-empty{display:grid;min-height:580px;padding:32px;place-items:center;text-align:center}.ima-inspector-empty-copy{max-width:300px}.ima-inspector-empty-title{margin:0;color:var(--ima-text);font-size:16px;font-weight:650;line-height:24px}.ima-inspector-empty-description{margin:8px 0 0;color:var(--ima-muted);font-size:13px;line-height:20px}.ima-inspector-head{display:flex;align-items:flex-start;gap:12px;padding-bottom:18px;border-bottom:1px solid var(--ima-line)}.ima-inspector-head-copy{min-width:0;flex:1}.ima-inspector-title{margin:1px 0 3px;font-size:17px;line-height:24px}.ima-inspector-status{color:var(--ima-muted);font-size:12px}.ima-inspector-status.ok{color:var(--ima-ok)}
|
|
191
197
|
.ima-form{display:flex;flex-direction:column;gap:16px;padding-top:20px}.ima-control{display:flex;flex-direction:column;gap:7px}.ima-control>span{color:var(--ima-muted);font-size:12px;font-weight:550}.ima-control input,.ima-control select{box-sizing:border-box;width:100%;min-height:44px;padding:0 12px;border:1px solid var(--ima-line);border-radius:9px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04));color:var(--ima-text);font:13px inherit;outline:none}.ima-control input:focus,.ima-control select:focus{border-color:var(--ima-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--ima-accent) 18%,transparent)}.ima-control option{background:#202124;color:#f2f3f5}
|
|
192
198
|
.ima-switch-row{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 2px}.ima-switch-copy strong{display:block;font-size:13px}.ima-switch-copy small{display:block;margin-top:2px;color:var(--ima-muted);font-size:11px}
|
|
193
|
-
.ima-inspector-actions{display:flex;align-items:center;gap:8px;margin-top:6px;padding-top:18px;border-top:1px solid var(--ima-line)}.ima-inspector-actions .ima-btn{min-height:36px}.ima-inspector-actions .danger{margin-left:auto;color:var(--ima-danger);border-color:color-mix(in srgb,var(--ima-danger) 35%,transparent)}
|
|
199
|
+
.ima-inspector-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:6px;padding-top:18px;border-top:1px solid var(--ima-line)}.ima-inspector-actions .ima-btn{flex:none;min-width:0;min-height:36px;padding:0 8px;font-size:12px;white-space:nowrap}.ima-inspector-actions .danger{margin-left:auto;color:var(--ima-danger);border-color:color-mix(in srgb,var(--ima-danger) 35%,transparent)}
|
|
194
200
|
.ima-save-note{min-height:18px;color:var(--ima-muted);font-size:11px}.ima-save-note.ok{color:var(--ima-ok)}
|
|
195
201
|
.ima-modal.ima-account-modal{width:min(560px,100%);max-height:min(760px,calc(100vh - 48px));overflow:auto}.ima-setup-section{margin:4px 0 14px;padding-bottom:14px;border-bottom:1px solid var(--ima-line)}
|
|
196
202
|
.ima-account-settings{display:grid;grid-template-columns:1fr 1fr;gap:12px}.ima-account-settings.compact{grid-template-columns:1fr}.ima-picker-field{display:flex;min-width:0;flex-direction:column;gap:7px}.ima-picker-field.wide{grid-column:1/-1}.ima-picker-label{color:var(--ima-muted);font-size:12px;font-weight:550}.ima-account-picker{width:100%}.ima-account-picker .ima-chip-btn{width:100%;height:auto;min-height:44px;justify-content:flex-start;padding:8px 12px;border:1px solid var(--ima-line);border-radius:9px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04));color:var(--ima-text);font-size:13px;text-align:left}.ima-account-picker .ima-chip-btn:hover,.ima-account-picker.is-open .ima-chip-btn{border-color:var(--ima-accent);background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04));box-shadow:0 0 0 2px color-mix(in srgb,var(--ima-accent) 18%,transparent)}.ima-account-picker .ima-chip-label{flex:1}.ima-account-picker .ima-chip-btn em{margin-left:auto}.ima-account-picker .ima-chip-menu{width:100%;min-width:100%;max-height:min(320px,calc(100vh - 120px))}.ima-account-picker.ima-model-select .ima-chip-btn{border-radius:9px}.ima-account-picker.ima-model-select .ima-chip-menu{width:max(100%,320px);min-width:100%}.ima-account-settings .ima-chip-dialog{grid-column:1/-1;margin-top:0}.ima-picker-note{grid-column:1/-1;color:var(--ima-muted);font-size:11px;line-height:1.5}.ima-picker-note.warning{color:var(--ima-warning)}
|
|
@@ -303,9 +309,11 @@ window.__ModuleLoader__.load({
|
|
|
303
309
|
|
|
304
310
|
const SERVER_TEXT_KEYS = new Map([
|
|
305
311
|
["未知渠道", "server.unknownChannel"], ["渠道未配置", "server.channelUnconfigured"], ["会话不存在", "server.sessionMissing"],
|
|
312
|
+
["账号不存在", "server.accountMissing"], ["账号连接失败,请查看本机日志", "server.accountConnectFailed"], ["重新连接失败,请查看本机日志", "server.accountReconnectFailed"],
|
|
313
|
+
["请选择提供商、模型、工作区或权限", "server.selectAccountSettings"], ["请选择提供商和模型", "server.selectModel"], ["请选择工作区", "server.selectWorkspace"], ["请选择权限", "server.selectPermission"], ["凭据不足,无法启动渠道", "server.missingCredentials"],
|
|
306
314
|
["该渠道不支持扫码绑定", "server.qrUnsupported"], ["二维码已过期", "server.qrExpired"], ["扫码未完成", "server.qrIncomplete"],
|
|
307
315
|
["未授权:请管理员在设置 → IM助理 中批准你的访问。", "server.accessDenied"],
|
|
308
|
-
["已断开", "status.disconnected"], ["重连失败", "status.reconnectFailed"], ["连接中", "status.connectingSocket"], ["等待网关握手", "status.waitHandshake"],
|
|
316
|
+
["未连接", "account.statusNotConnected"], ["已断开", "status.disconnected"], ["重连失败", "status.reconnectFailed"], ["连接中", "status.connectingSocket"], ["等待网关握手", "status.waitHandshake"],
|
|
309
317
|
["鉴权中", "status.authenticating"], ["已连接", "status.connected"], ["重连中", "status.reconnecting"], ["连接错误", "status.connectionError"], ["连接失败", "status.connectionFailed"],
|
|
310
318
|
["Stream 已连接", "status.streamConnected"], ["已停止", "status.stopped"], ["长连接已建立", "status.longConnection"], ["轮询中", "status.polling"],
|
|
311
319
|
["未登录", "status.notLoggedIn"], ["等待扫码", "status.waitQr"], ["已登录", "status.loggedIn"], ["已登录(自动恢复)", "status.loggedInRecovered"], ["登录中", "status.loggingIn"],
|
|
@@ -325,6 +333,13 @@ window.__ModuleLoader__.load({
|
|
|
325
333
|
const translated = t(key);
|
|
326
334
|
return translated === key ? (ch.label || ch.id) : translated;
|
|
327
335
|
}
|
|
336
|
+
function accountLabel(account, t) {
|
|
337
|
+
if (!account || !account.autoName) return account && (account.name || account.id) || "";
|
|
338
|
+
return t("account.defaultName", {
|
|
339
|
+
channel: channelLabel({ id: account.platform, label: account.platform }, t),
|
|
340
|
+
count: account.nameOrdinal || 1,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
328
343
|
function fieldLabel(ch, field, t) {
|
|
329
344
|
const key = "field." + ch.id + "." + field.key;
|
|
330
345
|
const translated = t(key);
|
|
@@ -527,7 +542,7 @@ window.__ModuleLoader__.load({
|
|
|
527
542
|
h("p", { className: "ima-hint" }, hintOf(ch, t)),
|
|
528
543
|
(busy || status === "starting") && h("div", { className: "ima-bind-status" }, t("bind.generating")),
|
|
529
544
|
(status === "expired" || status === "failed") && h("div", { className: "ima-error" }, serverText(pairing && pairing.error, t) || t("bind.retry")),
|
|
530
|
-
h("button", { className: "ima-btn primary", disabled: busy || !settings.cwd || !settings.provider || !settings.model || !settings.permission, onClick: () => startQr(qrStarted) }, busy ? t("bind.generating") : qrStarted ? t("bind.refresh") : "
|
|
545
|
+
h("button", { className: "ima-btn primary", disabled: busy || !settings.cwd || !settings.provider || !settings.model || !settings.permission, onClick: () => startQr(qrStarted) }, busy ? t("bind.generating") : qrStarted ? t("bind.refresh") : t("action.generateQr")),
|
|
531
546
|
)
|
|
532
547
|
),
|
|
533
548
|
tab === "manual" && hasManual && h("div", null,
|
|
@@ -797,12 +812,12 @@ window.__ModuleLoader__.load({
|
|
|
797
812
|
);
|
|
798
813
|
|
|
799
814
|
return h("div", { className: "ima-account-settings" + (props.compact ? " compact" : "") },
|
|
800
|
-
field("workspace", props.workspaceLabel || "
|
|
815
|
+
field("workspace", props.workspaceLabel || t("account.workspace"), h(ChipMenu, {
|
|
801
816
|
open: open === "workspace",
|
|
802
817
|
onToggle: (next) => setOpen(next ? "workspace" : ""),
|
|
803
818
|
icon: h(FolderIcon),
|
|
804
|
-
label: (workspace && (workspace.title || workspace.path)) || cwd || "
|
|
805
|
-
ariaLabel: props.workspaceLabel || "
|
|
819
|
+
label: (workspace && (workspace.title || workspace.path)) || cwd || t("account.selectWorkspace"),
|
|
820
|
+
ariaLabel: props.workspaceLabel || t("account.workspace"),
|
|
806
821
|
className: "ima-account-picker",
|
|
807
822
|
},
|
|
808
823
|
items.length === 0 && h("div", { className: "ima-chip-empty" }, t("composer.noWorkspaces")),
|
|
@@ -817,11 +832,11 @@ window.__ModuleLoader__.load({
|
|
|
817
832
|
h("div", { className: "ima-chip-split" }),
|
|
818
833
|
h(ChipRow, { icon: h(PlusIcon), label: t("composer.addWorkspace"), onClick: onAddWorkspace }),
|
|
819
834
|
), true),
|
|
820
|
-
field("model", "
|
|
835
|
+
field("model", modelT("menu.model"), h(ChipMenu, {
|
|
821
836
|
open: open === "model",
|
|
822
837
|
onToggle: (next) => { setOpen(next ? "model" : ""); if (next) setModelPane("root"); },
|
|
823
838
|
icon: null,
|
|
824
|
-
label: (currentModel && currentModel.label) || "
|
|
839
|
+
label: (currentModel && currentModel.label) || t("account.selectModel"),
|
|
825
840
|
title: currentModel && currentModel.label,
|
|
826
841
|
suffix: effortLabel,
|
|
827
842
|
ariaLabel: modelT("trigger.selectAria"),
|
|
@@ -830,7 +845,7 @@ window.__ModuleLoader__.load({
|
|
|
830
845
|
menuClassName: "ima-model-menu",
|
|
831
846
|
},
|
|
832
847
|
modelPane === "root" && [
|
|
833
|
-
h(ChipRow, { key: "model", kv: true, label: modelT("menu.model"), hint: (currentModel && currentModel.label) || "
|
|
848
|
+
h(ChipRow, { key: "model", kv: true, label: modelT("menu.model"), hint: (currentModel && currentModel.label) || t("account.selectModel"), chevron: true, onClick: () => setModelPane("model") }),
|
|
834
849
|
reasoning && h(ChipRow, { key: "effort", kv: true, label: modelT("menu.effort"), hint: effortLabel || modelT("effort.providerDefault"), chevron: true, onClick: () => setModelPane("effort") }),
|
|
835
850
|
],
|
|
836
851
|
modelPane === "model" && (models.length === 0
|
|
@@ -857,11 +872,11 @@ window.__ModuleLoader__.load({
|
|
|
857
872
|
onClick: () => { update({ provider, model, reasoningEffort: item.id }); setOpen(""); },
|
|
858
873
|
})),
|
|
859
874
|
)),
|
|
860
|
-
field("permission", "
|
|
875
|
+
field("permission", t("composer.permission"), h(ChipMenu, {
|
|
861
876
|
open: open === "permission",
|
|
862
877
|
onToggle: (next) => setOpen(next ? "permission" : ""),
|
|
863
878
|
icon: h(ShieldIcon),
|
|
864
|
-
label: (currentPermission && currentPermission.label) || "
|
|
879
|
+
label: (currentPermission && currentPermission.label) || t("account.selectPermission"),
|
|
865
880
|
ariaLabel: t("composer.permission"),
|
|
866
881
|
className: "ima-account-picker",
|
|
867
882
|
},
|
|
@@ -873,16 +888,16 @@ window.__ModuleLoader__.load({
|
|
|
873
888
|
onClick: () => selectPermission(item.value),
|
|
874
889
|
})),
|
|
875
890
|
)),
|
|
876
|
-
field("private", "
|
|
891
|
+
field("private", t("account.privateAccess"), h(ChipMenu, {
|
|
877
892
|
open: open === "private",
|
|
878
893
|
onToggle: (next) => setOpen(next ? "private" : ""),
|
|
879
894
|
icon: h(ShieldIcon),
|
|
880
|
-
label: privateAccess === "all" ? "
|
|
881
|
-
ariaLabel: "
|
|
895
|
+
label: privateAccess === "all" ? t("account.privateAll") : t("account.privateApproved"),
|
|
896
|
+
ariaLabel: t("account.privateAccess"),
|
|
882
897
|
className: "ima-account-picker",
|
|
883
898
|
},
|
|
884
|
-
h(ChipRow, { icon: h(ShieldIcon), label: "
|
|
885
|
-
h(ChipRow, { icon: h(ShieldIcon), label: "
|
|
899
|
+
h(ChipRow, { icon: h(ShieldIcon), label: t("account.privateApproved"), active: privateAccess === "approved", onClick: () => { update({ privateAccess: "approved" }); setOpen(""); } }),
|
|
900
|
+
h(ChipRow, { icon: h(ShieldIcon), label: t("account.privateAll"), active: privateAccess === "all", onClick: () => { update({ privateAccess: "all" }); setOpen(""); } }),
|
|
886
901
|
), true),
|
|
887
902
|
privateAccess === "all" && h("div", { className: "ima-picker-note warning" }, t("settings.publicChatNotice")),
|
|
888
903
|
adding && h("div", { className: "ima-chip-dialog" },
|
|
@@ -894,7 +909,7 @@ window.__ModuleLoader__.load({
|
|
|
894
909
|
),
|
|
895
910
|
),
|
|
896
911
|
hint && h("div", { className: "ima-picker-note" }, hint),
|
|
897
|
-
props.showAutoNameNote && h("div", { className: "ima-picker-note" }, "
|
|
912
|
+
props.showAutoNameNote && h("div", { className: "ima-picker-note" }, t("account.autoNameNote")),
|
|
898
913
|
h(RiskConfirmation, {
|
|
899
914
|
open: confirmingFullAccess,
|
|
900
915
|
title: permissionT("confirm.title"),
|
|
@@ -1205,7 +1220,7 @@ window.__ModuleLoader__.load({
|
|
|
1205
1220
|
const seq = ++saveSeq.current;
|
|
1206
1221
|
const next = { ...draft, ...patch };
|
|
1207
1222
|
setDraft(next);
|
|
1208
|
-
setNote("
|
|
1223
|
+
setNote("status.saving");
|
|
1209
1224
|
return onSave(account.id, {
|
|
1210
1225
|
name: next.name,
|
|
1211
1226
|
cwd: next.cwd,
|
|
@@ -1215,7 +1230,7 @@ window.__ModuleLoader__.load({
|
|
|
1215
1230
|
permission: next.permission,
|
|
1216
1231
|
privateAccess: next.privateAccess,
|
|
1217
1232
|
}).then((ok) => {
|
|
1218
|
-
if (seq === saveSeq.current) setNote(ok ? "
|
|
1233
|
+
if (seq === saveSeq.current) setNote(ok ? "status.saved" : "error.save");
|
|
1219
1234
|
return ok;
|
|
1220
1235
|
});
|
|
1221
1236
|
};
|
|
@@ -1234,8 +1249,8 @@ window.__ModuleLoader__.load({
|
|
|
1234
1249
|
h("div", { className: "ima-inspector-head" },
|
|
1235
1250
|
h(Logo, { id: account.platform }),
|
|
1236
1251
|
h("div", { className: "ima-inspector-head-copy" },
|
|
1237
|
-
h("h3", { className: "ima-inspector-title" }, account
|
|
1238
|
-
h("div", { className: account.connected ? "ima-inspector-status ok" : "ima-inspector-status" }, account.connected ? "
|
|
1252
|
+
h("h3", { className: "ima-inspector-title" }, accountLabel(account, t)),
|
|
1253
|
+
h("div", { className: account.connected ? "ima-inspector-status ok" : "ima-inspector-status" }, "● " + (account.connected ? t("account.statusRunning") : (serverText(account.status, t) || t("account.statusNotConnected")))),
|
|
1239
1254
|
h("div", { className: "ima-account-id" }, account.id),
|
|
1240
1255
|
),
|
|
1241
1256
|
),
|
|
@@ -1251,18 +1266,18 @@ window.__ModuleLoader__.load({
|
|
|
1251
1266
|
modelT,
|
|
1252
1267
|
permissionT,
|
|
1253
1268
|
compact: true,
|
|
1254
|
-
workspaceLabel: "
|
|
1269
|
+
workspaceLabel: t("account.currentWorkspace"),
|
|
1255
1270
|
t,
|
|
1256
1271
|
}),
|
|
1257
1272
|
h("div", { className: "ima-switch-row" },
|
|
1258
|
-
h("div", { className: "ima-switch-copy" }, h("strong", null, "
|
|
1259
|
-
h("button", { type: "button", className: draft.receiveEnabled ? "ima-switch" : "ima-switch off", role: "switch", "aria-checked": Boolean(draft.receiveEnabled), "aria-label": "
|
|
1273
|
+
h("div", { className: "ima-switch-copy" }, h("strong", null, t("account.receive")), h("small", null, t("account.receiveDescription"))),
|
|
1274
|
+
h("button", { type: "button", className: draft.receiveEnabled ? "ima-switch" : "ima-switch off", role: "switch", "aria-checked": Boolean(draft.receiveEnabled), "aria-label": t("account.receive"), onClick: () => onAction(account.id, "receive", { receiveEnabled: !draft.receiveEnabled }) }, h("i")),
|
|
1260
1275
|
),
|
|
1261
|
-
h("div", { className: note === "
|
|
1276
|
+
h("div", { className: note === "status.saved" ? "ima-save-note ok" : "ima-save-note" }, note && t(note)),
|
|
1262
1277
|
h("div", { className: "ima-inspector-actions" },
|
|
1263
|
-
h("button", { className: "ima-btn", onClick: () => onAction(account.id, "check") }, "
|
|
1264
|
-
h("button", { className: "ima-btn", onClick: () => onAction(account.id, "reconnect") }, "
|
|
1265
|
-
h("button", { className: "ima-btn danger", onClick: () => { if (window.confirm("
|
|
1278
|
+
h("button", { className: "ima-btn", onClick: () => onAction(account.id, "check") }, t("action.checkConnection")),
|
|
1279
|
+
h("button", { className: "ima-btn", onClick: () => onAction(account.id, "reconnect") }, t("action.reconnectAccount")),
|
|
1280
|
+
h("button", { className: "ima-btn danger", onClick: () => { if (window.confirm(t("account.removeConfirm"))) onAction(account.id, "remove"); } }, t("action.removeAccount")),
|
|
1266
1281
|
),
|
|
1267
1282
|
),
|
|
1268
1283
|
);
|
|
@@ -1344,15 +1359,15 @@ window.__ModuleLoader__.load({
|
|
|
1344
1359
|
return h("section", { className: "ima-page ima-account-page", "aria-label": t("settings.aria") },
|
|
1345
1360
|
h("header", { className: "ima-head" },
|
|
1346
1361
|
h("div", null,
|
|
1347
|
-
h("h2", { className: "ima-title" }, "
|
|
1348
|
-
h("p", { className: "ima-sub" }, "
|
|
1362
|
+
h("h2", { className: "ima-title" }, t("settings.title")),
|
|
1363
|
+
h("p", { className: "ima-sub" }, t("settings.description")),
|
|
1349
1364
|
),
|
|
1350
1365
|
),
|
|
1351
1366
|
error && h("div", { className: "ima-error" }, error),
|
|
1352
1367
|
pending.length > 0 && h("div", { className: "ima-pending" },
|
|
1353
1368
|
h("div", null, t("pending.notice")),
|
|
1354
1369
|
...pending.map((p) => h("div", { key: p.channelId + p.userId, className: "ima-pending-row" },
|
|
1355
|
-
h("span", { style: { flex: 1 } }, (p.username || p.userId) + " · " + (allAccounts.find((item) => item.id === p.channelId)
|
|
1370
|
+
h("span", { style: { flex: 1 } }, (p.username || p.userId) + " · " + (accountLabel(allAccounts.find((item) => item.id === p.channelId), t) || p.channelId)),
|
|
1356
1371
|
h("button", { className: "ima-btn", onClick: () => onAction(p.channelId, "approve", { userId: p.userId }) }, t("action.approve")),
|
|
1357
1372
|
h("button", { className: "ima-btn", onClick: () => onAction(p.channelId, "deny", { userId: p.userId }) }, t("action.deny")),
|
|
1358
1373
|
)),
|
|
@@ -1366,26 +1381,26 @@ window.__ModuleLoader__.load({
|
|
|
1366
1381
|
const open = canExpand && Boolean(expanded[ch.id]);
|
|
1367
1382
|
const toggleExpanded = canExpand ? () => setExpanded({ ...expanded, [ch.id]: !open }) : undefined;
|
|
1368
1383
|
const channelStatus = ch.total === 0
|
|
1369
|
-
? { label: "
|
|
1384
|
+
? { label: t("account.countZero"), tone: "muted" }
|
|
1370
1385
|
: ch.online === ch.total
|
|
1371
|
-
? { label:
|
|
1386
|
+
? { label: t("account.countOnline", { online: ch.online, total: ch.total }), tone: "online" }
|
|
1372
1387
|
: ch.online === 0
|
|
1373
|
-
? { label:
|
|
1374
|
-
: { label:
|
|
1388
|
+
? { label: t("account.countOffline", { total: ch.total }), tone: "offline" }
|
|
1389
|
+
: { label: t("account.countOnline", { online: ch.online, total: ch.total }), tone: "partial" };
|
|
1375
1390
|
return h("div", { key: ch.id, className: "ima-platform" + (open ? " open" : "") + (canExpand ? "" : " empty") },
|
|
1376
1391
|
h("div", { className: "ima-platform-head", role: canExpand ? "button" : undefined, tabIndex: canExpand ? 0 : undefined, "aria-expanded": canExpand ? open : undefined, onClick: toggleExpanded, onKeyDown: canExpand ? (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); toggleExpanded(); } } : undefined },
|
|
1377
1392
|
h(Logo, { id: ch.id }),
|
|
1378
1393
|
h("span", { className: "ima-platform-title" }, channelLabel(ch, t)),
|
|
1379
1394
|
h("span", { className: "ima-platform-count " + channelStatus.tone }, channelStatus.label),
|
|
1380
|
-
h("button", { className: "ima-platform-add", type: "button", onClick: (e) => { e.stopPropagation(); setEditing(ch.id); } }, "+
|
|
1395
|
+
h("button", { className: "ima-platform-add", type: "button", onClick: (e) => { e.stopPropagation(); setEditing(ch.id); } }, "+ " + t("action.addAccount")),
|
|
1381
1396
|
h("span", { className: canExpand ? "ima-platform-caret" : "ima-platform-caret empty", "aria-hidden": "true" }, canExpand && h(IconChevron)),
|
|
1382
1397
|
),
|
|
1383
1398
|
open && h("div", { className: "ima-account-list" },
|
|
1384
1399
|
...(ch.accounts || []).map((account) => h("button", { key: account.id, type: "button", className: account.id === selected ? "ima-account-row on" : "ima-account-row", onClick: () => selectAccount(account.id) },
|
|
1385
1400
|
h("span", { className: account.connected ? "ima-dot on" : "ima-dot" }),
|
|
1386
1401
|
h(Logo, { id: ch.id }),
|
|
1387
|
-
h("span", { className: "ima-account-copy" }, h("span", { className: "ima-account-name" }, account
|
|
1388
|
-
h("span", { className: busy[account.id] ? "ima-account-state" : account.connected ? "ima-account-state online" : "ima-account-state offline" }, busy[account.id] ? "
|
|
1402
|
+
h("span", { className: "ima-account-copy" }, h("span", { className: "ima-account-name" }, accountLabel(account, t)), h("span", { className: "ima-account-id" }, account.id)),
|
|
1403
|
+
h("span", { className: busy[account.id] ? "ima-account-state" : account.connected ? "ima-account-state online" : "ima-account-state offline" }, busy[account.id] ? t("account.statusProcessing") : account.connected ? t("account.statusOnline") : t("account.statusOffline")),
|
|
1389
1404
|
h("span", { className: "ima-account-next", "aria-hidden": "true" }, h(IconChevron)),
|
|
1390
1405
|
)),
|
|
1391
1406
|
),
|