@xmanrui/dsh-im 5.2.0 → 5.3.0
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/docs/client-integration.md +6 -2
- package/lib/client.js +398 -115
- package/lib/index.js +323 -321
- package/package.json +1 -1
- package/plugin-src/client/connection-error.js +2 -1
- package/plugin-src/client/global-settings.js +2 -1
- package/plugin-src/client/i18n.js +8 -0
- package/plugin-src/client/index.js +38 -18
- package/plugin-src/client/plugin-page.js +36 -9
- package/plugin-src/client/sidebar-settings.js +129 -0
- package/plugin-src/client/styles.js +8 -0
- package/plugin-src/host/channels/dingtalk/rpc.mjs +5 -1
- package/plugin-src/host/channels/feishu/rpc.mjs +5 -1
- package/plugin-src/host/channels/qq/rpc.mjs +5 -1
- package/plugin-src/host/channels/wecom/rpc.mjs +5 -1
- package/plugin-src/host/channels/weixin/rpc.mjs +3 -2
- package/plugin-src/host/channels/whatsapp/rpc.mjs +5 -1
- package/plugin-src/host/index.mjs +7 -0
- package/plugin-src/host/sidebar-settings.mjs +113 -0
- package/src/channels/imessage/imessage-api.mjs +67 -2
- package/src/channels/shared/connection-error.mjs +5 -5
- package/src/channels/shared/diagnostic-details.mjs +15 -1
- package/src/channels/shared/i18n-en/diagnostics.mjs +5 -0
- package/src/channels/shared/qr-encoding-error.mjs +39 -0
- package/src/channels/weixin/connection-error.mjs +1 -0
|
@@ -12,6 +12,10 @@ On DSH versions with plugin detail actions, **Open IM bots** opens the same mana
|
|
|
12
12
|
|
|
13
13
|
Hosts with `sidebar.panellist` also show **IM bots** in the left sidebar, targeting the same `main` panel as the detail action. The sidebar retains the catalog's linked speech bubbles as a 16×16 vector with the host's regular 1px stroke, using `currentColor` and the requested icon size; the catalog keeps its original color image. This entry does not call `setSettingsVisible()`: both existing entry points remain available. Sidebar withdrawal removes only its entry, while main-slot or navigation-service withdrawal cleans up all related registrations.
|
|
14
14
|
|
|
15
|
+
「IM机器人 → 通用设置 → 通用 → 侧边栏入口」可选择「自动隐藏」「始终显示」或「始终隐藏」。默认自动隐藏:没有已保存的渠道时显示,至少一个渠道保存成功后隐藏,删除全部渠道后恢复。离线渠道仍算已配置,扫码过程不算;隐藏不会停止机器人或关闭已打开的面板。设置保存在 DSH home 下的 `integrations/dsh-im/sidebar-settings.json`,通过独立的 `/api/dsh-im/dsh-im-sidebar` 管理接口读写,遵循与渠道管理相同的 `rpcAuthority`(默认 `trusted-host`),支持 DSH 已认证并通过 Host/Origin 校验的局域网与域名访问;TTL 等通用设置仍仅限本机。选择后自动保存并立即更新当前客户端,无需点击保存按钮;其他客户端在下一次管理操作或最多约 30 秒后同步。启动时先隐藏,收到 Host 确认零渠道配置或「始终显示」后才注册侧边栏入口,避免先显示再隐藏造成布局闪动。读取失败时保留上次确认的状态,初始保持隐藏;设置和插件详情入口始终独立可用。读取失败时仍可选择并保存「始终显示/始终隐藏」,恢复入口;自动模式仍须成功读取渠道配置。
|
|
16
|
+
|
|
17
|
+
**IM bots → General settings → General → Sidebar entry** offers Auto-hide, Always show, and Always hide. Auto-hide shows the entry with no saved channels, hides it after at least one channel is saved, and restores it when all channels are removed. Offline channels still count; pending QR logins do not. Hiding neither stops bots nor closes an open panel. The preference is stored in `integrations/dsh-im/sidebar-settings.json` under the DSH home and uses the dedicated `/api/dsh-im/dsh-im-sidebar` route. It follows channel management `rpcAuthority` (default `trusted-host`), allowing LAN and domain access already authenticated and admitted by DSH Host/Origin checks. General settings such as TTL remain loopback-only. Selecting a mode saves it automatically and updates this client immediately, without a Save button; other clients refresh after management operations or within about 30 seconds. Startup keeps the entry hidden until the Host confirms zero saved channels or Always show, avoiding a temporary row that shifts the sidebar. Failed reads retain the last confirmed visibility, initially hidden; Settings and plugin details remain independently available. Failed reads still allow saving Always show / Always hide to recover the entry; Auto-hide still requires a successful channel configuration read.
|
|
18
|
+
|
|
15
19
|
```ts
|
|
16
20
|
interface DshImClient {
|
|
17
21
|
readonly version: 1;
|
|
@@ -34,9 +38,9 @@ interface DshImClient {
|
|
|
34
38
|
|
|
35
39
|
`preferredSectionId` selects the initial section using the IDs above. Missing or unknown IDs default to WeChat. Changing the prop after mounting does not override the reader's selection; remount deliberately to reset it.
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
`setSettingsVisible()` 只影响当前客户端内存,不写服务器配置或浏览器存储。因此桌面端隐藏设置入口不影响另一个浏览器。刷新后恢复默认,由宿主再次按需接管。隐藏入口不会停止机器人或外部已挂载的面板。V1 按一个活跃管理面板接入,不提供多个面板间的状态同步。此 API 与上方持久化的侧边栏入口设置独立。
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
`setSettingsVisible()` is local to this client instance and is never persisted. A desktop shell cannot hide Settings in another browser. Reload restores the default until the shell opts in again. Hiding settings does not stop bots or unmount an embedded panel. V1 targets one active management panel and does not synchronize multiple copies. This API is independent of the persisted sidebar preference above.
|
|
40
44
|
|
|
41
45
|
## 宿主接入 / Shell lifecycle
|
|
42
46
|
|