@musdrop/ds-harness-remote 0.6.12 → 0.6.14

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/README.md CHANGED
@@ -1,28 +1,28 @@
1
- > [!IMPORTANT]
2
- > # 这是一个 fork,不是原版
3
- >
4
- > 本包 [`@musdrop/ds-harness-remote`](https://github.com/musdrop/ds-harness-remote) 是 [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote)(原版 npm 包 `ds-harness-remote`)的 fork,在原有全部功能之上新增了**跨设备模型借出/借用**。
5
- >
6
- > **新增功能:模型共享**
7
- >
8
- > - **借出(Lend)**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
9
- > - **借用(Borrow)**:借用其它设备借出的模型。借到的模型出现在本机模型选择器中,以对方**设备名称**作为提供商名,其下列出具体模型。
10
- > - **双向授权**:借出方按提供商/设备配置允许借出哪些模型;借用方按设备决定是否启用。只有两边都同意的模型才会出现在选择器里。
11
- > - **端到端加密**:模型请求走 ds-harness-remote 既有的 Noise 加密 P2P/中继通道,凭据不出本机。
12
- > - 配置入口:**设置 → 插件 → 本插件详情 → 「模型共享」区块**;也可用 CLI(`ds-harness-remote model-share show` 等),详见 [docs/model-sharing.md](https://github.com/musdrop/ds-harness-remote/blob/main/docs/model-sharing.md)。
13
- >
14
- > **⚠️ 与原版不能同时安装**
15
- >
16
- > 本包与原版 `ds-harness-remote` 使用**相同的插件 ID**(`com.r2049.ds-harness-remote`),同一个 DSH profile 里**只能装两者之一**——同时安装时插件管理器把二者视为同一插件,启用开关互相影响、无法各自独立启停。
17
- >
18
- > 也正因为同 ID,本包可以直接**替换**原版:卸载原版、安装本包后,原有 Remote 配置(服务器地址、已授权设备、登录状态等)全部无缝继承,无需重新配对。模型共享的借出/借用配置存在独立的 `model-share.json`,不占用原版配置字段。想恢复原版时反向操作即可。
19
- >
20
- > **安装本包**:先在插件管理里卸载原版 `ds-harness-remote`,再安装 `@musdrop/ds-harness-remote`,重启 DSH。
21
- >
22
- > 以下为原版 README。原有功能(远程工作区、会话接管、终端、文件上传下载、CodeX/ACP 等)在本包中全部可用。
23
-
24
- ---
25
-
1
+ > [!IMPORTANT]
2
+ > # 这是一个 fork,不是原版
3
+ >
4
+ > 本包 [`@musdrop/ds-harness-remote`](https://github.com/musdrop/ds-harness-remote) 是 [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote)(原版 npm 包 `ds-harness-remote`)的 fork,在原有全部功能之上新增了**跨设备模型借出/借用**。
5
+ >
6
+ > **新增功能:模型共享**
7
+ >
8
+ > - **借出(Lend)**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
9
+ > - **借用(Borrow)**:借用其它设备借出的模型。借到的模型出现在本机模型选择器中,以对方**设备名称**作为提供商名,其下列出具体模型。
10
+ > - **双向授权**:借出方按提供商/设备配置允许借出哪些模型;借用方按设备决定是否启用。只有两边都同意的模型才会出现在选择器里。
11
+ > - **端到端加密**:模型请求走 ds-harness-remote 既有的 Noise 加密 P2P/中继通道,凭据不出本机。
12
+ > - 配置入口:**设置 → 插件 → 本插件详情 → 「模型共享」区块**;也可用 CLI(`ds-harness-remote model-share show` 等),详见 [docs/model-sharing.md](https://github.com/musdrop/ds-harness-remote/blob/main/docs/model-sharing.md)。
13
+ >
14
+ > **⚠️ 与原版不能同时安装**
15
+ >
16
+ > 本包与原版 `ds-harness-remote` 使用**相同的插件 ID**(`com.r2049.ds-harness-remote`),同一个 DSH profile 里**只能装两者之一**——同时安装时插件管理器把二者视为同一插件,启用开关互相影响、无法各自独立启停。
17
+ >
18
+ > 也正因为同 ID,本包可以直接**替换**原版:卸载原版、安装本包后,原有 Remote 配置(服务器地址、已授权设备、登录状态等)全部无缝继承,无需重新配对。模型共享的借出/借用配置存在独立的 `model-share.json`,不占用原版配置字段。想恢复原版时反向操作即可。
19
+ >
20
+ > **安装本包**:先在插件管理里卸载原版 `ds-harness-remote`,再安装 `@musdrop/ds-harness-remote`,重启 DSH。
21
+ >
22
+ > 以下为原版 README。原有功能(远程工作区、会话接管、终端、文件上传下载、CodeX/ACP 等)在本包中全部可用。
23
+
24
+ ---
25
+
26
26
  # DeepSeek Harness Remote
27
27
 
28
28
  Continue DeepSeek Harness sessions and experimental Codex, Cursor, and Antigravity workspaces from another device over an end-to-end encrypted connection.
package/dist/client.js CHANGED
@@ -2215,7 +2215,16 @@ If a code was sent, recover the original submission without changing it.`,
2215
2215
  modelShareBorrowFrom: "Borrow from",
2216
2216
  modelShareOffline: "offline",
2217
2217
  modelShareOnline: "online",
2218
- modelShareNotLoaded: "Model sharing settings are unavailable."
2218
+ modelShareNotLoaded: "Model sharing settings are unavailable.",
2219
+ modelShareSelectedCount: "{count} selected",
2220
+ modelShareBorrowStatusOk: "Connected: {count} model(s) available in the picker.",
2221
+ modelShareBorrowStatusDisconnected: "Not connected to Remote: borrowing cannot sync.",
2222
+ modelShareBorrowStatusFailed: "Connection failed: {reason}",
2223
+ modelShareBorrowStatusPeerEmpty: "This device lends nothing usable right now.",
2224
+ modelShareRuleAnyDeviceHint: "A rule without any selected device applies to every authorized peer.",
2225
+ modelShareEdit: "Edit",
2226
+ modelShareSaveEdit: "Save rule",
2227
+ modelShareSelectModelsHint: "No models selected yet"
2219
2228
  }, zh = {
2220
2229
  uploadTooLarge: "\u6587\u4EF6\u8D85\u8FC7\u5F53\u524D\u8FDE\u63A5\u7684\u5355\u6587\u4EF6\u4E0A\u4F20\u4E0A\u9650\uFF08{size}\uFF09\u3002",
2221
2230
  relayUploadTooLarge: "\u6587\u4EF6\u8D85\u8FC7\u5F53\u524D\u8FDE\u63A5\u7684\u5355\u6587\u4EF6\u4E0A\u4F20\u4E0A\u9650\uFF08{size}\uFF09\u3002Relay \u548C TURN \u4E0A\u4F20\u65F6\uFF0C\u666E\u901A\u7528\u6237\u6BCF\u4E2A\u6587\u4EF6\u6700\u591A 20 MiB\uFF0C\u652F\u6301\u4F1A\u5458\u989D\u5EA6\u7684\u8FDE\u63A5\u6700\u591A 100 MiB\u3002",
@@ -2653,7 +2662,16 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2653
2662
  modelShareBorrowFrom: "\u501F\u7528\u81EA",
2654
2663
  modelShareOffline: "\u79BB\u7EBF",
2655
2664
  modelShareOnline: "\u5728\u7EBF",
2656
- modelShareNotLoaded: "\u6A21\u578B\u5171\u4EAB\u8BBE\u7F6E\u4E0D\u53EF\u7528\u3002"
2665
+ modelShareNotLoaded: "\u6A21\u578B\u5171\u4EAB\u8BBE\u7F6E\u4E0D\u53EF\u7528\u3002",
2666
+ modelShareSelectedCount: "\u5DF2\u9009 {count} \u9879",
2667
+ modelShareBorrowStatusOk: "\u5DF2\u8FDE\u63A5\uFF1A{count} \u4E2A\u6A21\u578B\u53EF\u7528\u3002",
2668
+ modelShareBorrowStatusDisconnected: "\u672A\u8FDE\u63A5\u5230\u8FDC\u7A0B\uFF1A\u501F\u7528\u65E0\u6CD5\u540C\u6B65\u3002",
2669
+ modelShareBorrowStatusFailed: "\u8FDE\u63A5\u5931\u8D25\uFF1A{reason}",
2670
+ modelShareBorrowStatusPeerEmpty: "\u8BE5\u8BBE\u5907\u5F53\u524D\u6CA1\u6709\u53EF\u501F\u7528\u7684\u6A21\u578B\u3002",
2671
+ modelShareRuleAnyDeviceHint: "\u672A\u9009\u62E9\u4EFB\u4F55\u8BBE\u5907\u7684\u89C4\u5219\u5BF9\u6240\u6709\u5DF2\u6388\u6743\u7684\u8BBE\u5907\u751F\u6548\u3002",
2672
+ modelShareEdit: "\u7F16\u8F91",
2673
+ modelShareSaveEdit: "\u4FDD\u5B58\u89C4\u5219",
2674
+ modelShareSelectModelsHint: "\u5C1A\u672A\u9009\u62E9\u6A21\u578B"
2657
2675
  }, ru = {
2658
2676
  uploadTooLarge: "\u0424\u0430\u0439\u043B \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0435\u0442 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u043B\u0438\u043C\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 ({size}).",
2659
2677
  relayUploadTooLarge: "\u0424\u0430\u0439\u043B \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0435\u0442 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u043B\u0438\u043C\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 ({size}). \u0427\u0435\u0440\u0435\u0437 Relay \u0438 TURN \u043B\u0438\u043C\u0438\u0442 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442 20 \u041C\u0438\u0411 \u043D\u0430 \u0444\u0430\u0439\u043B \u0438\u043B\u0438 100 \u041C\u0438\u0411, \u0435\u0441\u043B\u0438 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043B\u0438\u043C\u0438\u0442 \u043F\u043E\u0434\u043F\u0438\u0441\u043A\u0438.",
@@ -3091,7 +3109,16 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3091
3109
  modelShareBorrowFrom: "\u0417\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0438\u0437",
3092
3110
  modelShareOffline: "\u043E\u0444\u043B\u0430\u0439\u043D",
3093
3111
  modelShareOnline: "\u043E\u043D\u043B\u0430\u0439\u043D",
3094
- modelShareNotLoaded: "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043E\u0431\u043C\u0435\u043D\u0430 \u043C\u043E\u0434\u0435\u043B\u044F\u043C\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B."
3112
+ modelShareNotLoaded: "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043E\u0431\u043C\u0435\u043D\u0430 \u043C\u043E\u0434\u0435\u043B\u044F\u043C\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B.",
3113
+ modelShareSelectedCount: "\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {count}",
3114
+ modelShareBorrowStatusOk: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E: \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u2014 {count}.",
3115
+ modelShareBorrowStatusDisconnected: "\u041D\u0435\u0442 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u043A Remote: \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u044F \u0437\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u0430.",
3116
+ modelShareBorrowStatusFailed: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F: {reason}",
3117
+ modelShareBorrowStatusPeerEmpty: "\u042D\u0442\u043E \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442 \u043C\u043E\u0434\u0435\u043B\u0435\u0439.",
3118
+ modelShareRuleAnyDeviceHint: "\u041F\u0440\u0430\u0432\u0438\u043B\u043E \u0431\u0435\u0437 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043B\u044F \u0432\u0441\u0435\u0445 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432.",
3119
+ modelShareEdit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
3120
+ modelShareSaveEdit: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3121
+ modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u044B"
3095
3122
  }, uk = {
3096
3123
  uploadTooLarge: "\u0424\u0430\u0439\u043B \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u043F\u043E\u0442\u043E\u0447\u043D\u0438\u0439 \u043B\u0456\u043C\u0456\u0442 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F ({size}).",
3097
3124
  relayUploadTooLarge: "\u0424\u0430\u0439\u043B \u043F\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u043F\u043E\u0442\u043E\u0447\u043D\u0438\u0439 \u043B\u0456\u043C\u0456\u0442 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F ({size}). \u0427\u0435\u0440\u0435\u0437 Relay \u0456 TURN \u043B\u0456\u043C\u0456\u0442 \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C 20 \u041C\u0456\u0411 \u043D\u0430 \u0444\u0430\u0439\u043B \u0430\u0431\u043E 100 \u041C\u0456\u0411, \u044F\u043A\u0449\u043E \u0437\u2019\u0454\u0434\u043D\u0430\u043D\u043D\u044F \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454 \u043B\u0456\u043C\u0456\u0442 \u043F\u0435\u0440\u0435\u0434\u043F\u043B\u0430\u0442\u0438.",
@@ -3529,7 +3556,16 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3529
3556
  modelShareBorrowFrom: "\u041F\u043E\u0437\u0438\u0447\u0430\u0442\u0438 \u0437",
3530
3557
  modelShareOffline: "\u043E\u0444\u043B\u0430\u0439\u043D",
3531
3558
  modelShareOnline: "\u043E\u043D\u043B\u0430\u0439\u043D",
3532
- modelShareNotLoaded: "\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u044C\u043E\u0432\u043E\u0433\u043E \u043E\u0431\u043C\u0456\u043D\u0443 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456."
3559
+ modelShareNotLoaded: "\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u044C\u043E\u0432\u043E\u0433\u043E \u043E\u0431\u043C\u0456\u043D\u0443 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456.",
3560
+ modelShareSelectedCount: "\u0412\u0438\u0431\u0440\u0430\u043D\u043E: {count}",
3561
+ modelShareBorrowStatusOk: "\u041F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043E: \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u2014 {count}.",
3562
+ modelShareBorrowStatusDisconnected: "\u041D\u0435\u043C\u0430\u0454 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F \u0434\u043E Remote: \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0456\u0437\u0430\u0446\u0456\u044F \u043F\u043E\u0437\u0438\u0447\u0430\u043D\u043D\u044F \u043D\u0435\u043C\u043E\u0436\u043B\u0438\u0432\u0430.",
3563
+ modelShareBorrowStatusFailed: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F: {reason}",
3564
+ modelShareBorrowStatusPeerEmpty: "\u0426\u0435\u0439 \u043F\u0440\u0438\u0441\u0442\u0440\u0456\u0439 \u0437\u0430\u0440\u0430\u0437 \u043D\u0435 \u043D\u0430\u0434\u0430\u0454 \u043C\u043E\u0434\u0435\u043B\u0435\u0439.",
3565
+ modelShareRuleAnyDeviceHint: "\u041F\u0440\u0430\u0432\u0438\u043B\u043E \u0431\u0435\u0437 \u0432\u0438\u0431\u0440\u0430\u043D\u0438\u0445 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457\u0432 \u0434\u0456\u0454 \u0434\u043B\u044F \u0432\u0441\u0456\u0445 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u0438\u0445 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457\u0432.",
3566
+ modelShareEdit: "\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",
3567
+ modelShareSaveEdit: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3568
+ modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0456 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E"
3533
3569
  };
3534
3570
 
3535
3571
  // packages/plugin/src/client/header.ts
@@ -4337,7 +4373,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4337
4373
  }
4338
4374
  function createModelSharingSection(React) {
4339
4375
  return function(props) {
4340
- let { control, t, available = !0 } = props, [view, setView] = React.useState(void 0), [busy, setBusy] = React.useState(!1), [error, setError] = React.useState(void 0), [notice, setNotice] = React.useState(void 0), [grantDevice, setGrantDevice] = React.useState(""), [grantProvider, setGrantProvider] = React.useState(""), [grantModels, setGrantModels] = React.useState(""), [concurrencyDraft, setConcurrencyDraft] = React.useState(void 0), viewRef = React.useRef(void 0), queueRef = React.useRef(Promise.resolve()), busyRef = React.useRef(!1), applyView = (next) => {
4376
+ let { control, t, available = !0 } = props, [view, setView] = React.useState(void 0), [busy, setBusy] = React.useState(!1), [error, setError] = React.useState(void 0), [notice, setNotice] = React.useState(void 0), [grantSelectedModels, setGrantSelectedModels] = React.useState([]), [grantAllOfProvider, setGrantAllOfProvider] = React.useState([]), [grantAnyDevice, setGrantAnyDevice] = React.useState(!0), [grantDevices, setGrantDevices] = React.useState([]), [editingGrant, setEditingGrant] = React.useState(!1), [concurrencyDraft, setConcurrencyDraft] = React.useState(void 0), viewRef = React.useRef(void 0), queueRef = React.useRef(Promise.resolve()), busyRef = React.useRef(!1), applyView = (next) => {
4341
4377
  viewRef.current = next, setView(next), setConcurrencyDraft(void 0);
4342
4378
  }, load = React.useCallback(async () => {
4343
4379
  setError(void 0);
@@ -4366,23 +4402,6 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4366
4402
  enqueue((current) => ({ ...current, host: { ...current.host, ...changes } }));
4367
4403
  }, patchSources = (sources) => {
4368
4404
  enqueue((current) => ({ ...current, borrower: { ...current.borrower, sources } }));
4369
- }, toggleAllowedDevice = (deviceId) => {
4370
- if (view === void 0) return;
4371
- let current = view.store.host.allowedDevices, next = current.includes(deviceId) ? current.filter((id) => id !== deviceId) : [...current, deviceId];
4372
- patchHost({ allowedDevices: next });
4373
- }, addGrant = () => {
4374
- if (view === void 0 || grantProvider.trim() === "") return;
4375
- let provider = grantProvider.trim(), models = grantModels.split(",").map((item) => item.trim()).filter((item) => item !== ""), grants = [
4376
- ...view.store.host.grants.filter((item) => !(item.provider === provider && item.deviceId === (grantDevice.trim() || void 0))),
4377
- {
4378
- ...grantDevice.trim() === "" ? {} : { deviceId: grantDevice.trim() },
4379
- provider,
4380
- models
4381
- }
4382
- ];
4383
- patchHost({ grants }), setGrantDevice(""), setGrantProvider(""), setGrantModels("");
4384
- }, removeGrant = (index) => {
4385
- view !== void 0 && patchHost({ grants: view.store.host.grants.filter((_, i) => i !== index) });
4386
4405
  }, toggleSource = (deviceId, hostName) => {
4387
4406
  if (view === void 0) return;
4388
4407
  let sources = { ...view.store.borrower.sources }, current = sources[deviceId];
@@ -4391,7 +4410,52 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4391
4410
  models: current?.models ?? [],
4392
4411
  hostName: current?.hostName ?? hostName
4393
4412
  }, patchSources(sources);
4394
- }, label = (device) => `${device.name}${device.online ? ` \xB7 ${t("modelShareOnline")}` : device.known ? ` \xB7 ${t("modelShareOffline")}` : ""}`;
4413
+ }, removeGrant = (index) => {
4414
+ view !== void 0 && patchHost({ grants: view.store.host.grants.filter((_, i) => i !== index) });
4415
+ }, toggleGrantModel = (routeKey) => {
4416
+ setGrantSelectedModels((current) => current.includes(routeKey) ? current.filter((id) => id !== routeKey) : [...current, routeKey]);
4417
+ }, toggleGrantAllOfProvider = (provider) => {
4418
+ setGrantAllOfProvider((current) => current.includes(provider) ? current.filter((id) => id !== provider) : [...current, provider]);
4419
+ }, toggleGrantDevice = (deviceId) => {
4420
+ setGrantDevices((current) => current.includes(deviceId) ? current.filter((id) => id !== deviceId) : [...current, deviceId]);
4421
+ }, addGrant = () => {
4422
+ if (view === void 0) return;
4423
+ let anyDevice = grantAnyDevice || grantDevices.length === 0, replaced = new Set(anyDevice ? ["*"] : grantDevices), selected = new Set(grantSelectedModels), allProviders = new Set(grantAllOfProvider), grants = view.store.host.grants.filter((grant) => allProviders.has(grant.provider) ? !1 : grant.models.length === 0 ? !0 : !grant.models.some((model) => selected.has(`${grant.provider}::${model}`)));
4424
+ for (let deviceId of anyDevice ? [void 0] : grantDevices) {
4425
+ for (let provider of grantAllOfProvider)
4426
+ grants.push({ ...deviceId === void 0 ? {} : { deviceId }, provider, models: [] });
4427
+ for (let route of grantSelectedModels) {
4428
+ let separator = route.indexOf("::");
4429
+ if (separator <= 0) continue;
4430
+ let provider = route.slice(0, separator);
4431
+ allProviders.has(provider) || grants.push({
4432
+ ...deviceId === void 0 ? {} : { deviceId },
4433
+ provider,
4434
+ models: [.../* @__PURE__ */ new Set([
4435
+ ...grants.filter((grant) => grant.provider === provider && grant.deviceId === deviceId).flatMap((grant) => grant.models),
4436
+ route.slice(separator + 2)
4437
+ ])]
4438
+ });
4439
+ }
4440
+ }
4441
+ patchHost({ grants, enabled: !0 }), setGrantSelectedModels([]), setGrantAllOfProvider([]), setGrantAnyDevice(!0), setGrantDevices([]), setEditingGrant(!1);
4442
+ }, resetGrantForm = () => {
4443
+ setGrantSelectedModels([]), setGrantAllOfProvider([]), setGrantAnyDevice(!0), setGrantDevices([]), setEditingGrant(!1);
4444
+ }, label = (device) => `${device.name}${device.online ? ` \xB7 ${t("modelShareOnline")}` : device.known ? ` \xB7 ${t("modelShareOffline")}` : ""}`, peerName = (deviceId) => view?.peers.find((device) => device.deviceId === deviceId)?.name ?? deviceId, grantModelsSummary = (models) => models.length === 0 ? t("modelShareAllModels") : models.join(", "), borrowStatus = (deviceId, source) => {
4445
+ if (view === void 0 || source?.enabled !== !0) return;
4446
+ let diagnostics = view.borrowerDiagnostics;
4447
+ if (diagnostics.syncAvailable !== !0)
4448
+ return { cls: " isFailed", text: t("modelShareBorrowStatusDisconnected") };
4449
+ let entry = diagnostics.sources.find((item) => item.hostId === deviceId);
4450
+ if (entry !== void 0) {
4451
+ if (entry.outcome === "registered")
4452
+ return { cls: " isPassed", text: t("modelShareBorrowStatusOk", { count: entry.modelCount }) };
4453
+ if (entry.outcome === "failed")
4454
+ return { cls: " isFailed", text: t("modelShareBorrowStatusFailed", { reason: entry.error ?? "" }) };
4455
+ if (entry.outcome === "host-disabled" || entry.outcome === "no-models")
4456
+ return { cls: " isFailed", text: t("modelShareBorrowStatusPeerEmpty") };
4457
+ }
4458
+ };
4395
4459
  if (view === void 0)
4396
4460
  return React.createElement(
4397
4461
  "div",
@@ -4403,7 +4467,12 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4403
4467
  React.createElement("p", null, error ?? t("modelShareNotLoaded"))
4404
4468
  )
4405
4469
  );
4406
- let { host, borrower } = view.store, disabled = busy || !view.writable || !available, lendingRows = React.createElement(
4470
+ let { host, borrower } = view.store, disabled = busy || !view.writable || !available, draftModels = view.localProviders.flatMap((provider) => provider.models.map((model) => ({ provider, model }))), selectedCount = grantSelectedModels.length + grantAllOfProvider.length, modelsSummary = selectedCount === 0 ? t("modelShareSelectModelsHint") : t("modelShareSelectedCount", { count: selectedCount }), devicesSummary = grantAnyDevice || grantDevices.length === 0 ? t("modelShareAnyDevice") : t("modelShareSelectedCount", { count: grantDevices.length }), deviceSummaryLine = `${t("modelShareDevice")}: ${devicesSummary}`, modelSummaryLine = `${t("modelShareModels")}: ${modelsSummary}`, grantGroups = [];
4471
+ host.grants.forEach((grant, index) => {
4472
+ let group = grantGroups.find((candidate) => candidate.provider === grant.provider);
4473
+ group === void 0 && (group = { provider: grant.provider, entries: [] }, grantGroups.push(group)), group.entries.push({ index, grant });
4474
+ });
4475
+ let lendingRows = React.createElement(
4407
4476
  "div",
4408
4477
  { className: "dshRemoteAcpList" },
4409
4478
  React.createElement(
@@ -4415,31 +4484,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4415
4484
  React.createElement(
4416
4485
  "div",
4417
4486
  { className: "dshRemoteAcpRowInfo" },
4418
- React.createElement("strong", { className: "dshRemoteAcpName" }, t("modelShareEnableLending")),
4419
- React.createElement("p", null, t("modelShareLendingHint"))
4420
- ),
4421
- React.createElement("input", {
4422
- type: "checkbox",
4423
- role: "switch",
4424
- className: "dshRemoteSwitch",
4425
- checked: host.enabled,
4426
- "aria-checked": host.enabled,
4427
- disabled,
4428
- "aria-label": t("modelShareEnableLending"),
4429
- onChange: (event) => patchHost({ enabled: event.target.checked })
4430
- })
4431
- )
4432
- ),
4433
- React.createElement(
4434
- "div",
4435
- { className: "dshRemoteAcpRow" },
4436
- React.createElement(
4437
- "div",
4438
- { className: "dshRemoteAcpRowMain" },
4439
- React.createElement(
4440
- "div",
4441
- { className: "dshRemoteAcpRowInfo" },
4442
- React.createElement("strong", { className: "dshRemoteAcpName" }, t("modelShareMaxConcurrent"))
4487
+ React.createElement(
4488
+ "div",
4489
+ { className: "dshRemoteAcpRowInfo" },
4490
+ React.createElement("strong", { className: "dshRemoteAcpName" }, t("modelShareMaxConcurrent"))
4491
+ )
4443
4492
  ),
4444
4493
  React.createElement(
4445
4494
  "div",
@@ -4459,12 +4508,13 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4459
4508
  }
4460
4509
  })
4461
4510
  )
4462
- )
4511
+ ),
4512
+ React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareRuleAnyDeviceHint"))
4463
4513
  ),
4464
- ...view.peers.map((device) => React.createElement(
4514
+ ...grantGroups.map((group) => React.createElement(
4465
4515
  "div",
4466
4516
  {
4467
- key: `allow-${device.deviceId}`,
4517
+ key: `grant-group-${group.provider}`,
4468
4518
  className: "dshRemoteAcpRow"
4469
4519
  },
4470
4520
  React.createElement(
@@ -4473,51 +4523,47 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4473
4523
  React.createElement(
4474
4524
  "div",
4475
4525
  { className: "dshRemoteAcpRowInfo" },
4476
- React.createElement("strong", { className: "dshRemoteAcpName" }, label(device))
4477
- ),
4478
- React.createElement("input", {
4479
- type: "checkbox",
4480
- role: "switch",
4481
- className: "dshRemoteSwitch",
4482
- checked: host.allowedDevices.includes(device.deviceId),
4483
- "aria-checked": host.allowedDevices.includes(device.deviceId),
4484
- disabled,
4485
- "aria-label": `${t("modelShareAllowlist")}: ${label(device)}`,
4486
- onChange: () => toggleAllowedDevice(device.deviceId)
4487
- })
4488
- )
4489
- )),
4490
- ...host.grants.map((grant, index) => React.createElement(
4491
- "div",
4492
- {
4493
- key: `grant-${index}`,
4494
- className: "dshRemoteAcpRow"
4495
- },
4526
+ React.createElement("strong", { className: "dshRemoteAcpName" }, group.provider)
4527
+ )
4528
+ ),
4496
4529
  React.createElement(
4530
+ "p",
4531
+ { className: "dshRemoteAcpDiag" },
4532
+ grantModelsSummary([...new Set(group.entries.map((entry) => entry.grant.models).flat())])
4533
+ ),
4534
+ ...group.entries.map((entry) => React.createElement(
4497
4535
  "div",
4498
- { className: "dshRemoteAcpRowMain" },
4499
- React.createElement(
4500
- "div",
4501
- { className: "dshRemoteAcpRowInfo" },
4502
- React.createElement(
4503
- "strong",
4504
- { className: "dshRemoteAcpName" },
4505
- `${grant.provider} \xB7 ${grant.models.length === 0 ? t("modelShareAllModels") : grant.models.join(", ")}`
4506
- ),
4507
- React.createElement("p", null, grant.deviceId ?? t("modelShareAnyDevice"))
4508
- ),
4536
+ {
4537
+ key: `grant-${entry.index}`,
4538
+ className: "dshRemoteModelShareGrantEntry"
4539
+ },
4540
+ React.createElement("span", null, [
4541
+ entry.grant.deviceId === void 0 ? t("modelShareAnyDevice") : peerName(entry.grant.deviceId),
4542
+ grantModelsSummary(entry.grant.models)
4543
+ ].join(" \xB7 ")),
4509
4544
  React.createElement(
4510
4545
  "div",
4511
4546
  { className: "dshRemoteAcpRowActions" },
4547
+ React.createElement("button", {
4548
+ type: "button",
4549
+ className: "dshRemoteAcpActionBtn",
4550
+ disabled,
4551
+ "aria-label": `${t("modelShareEdit")}: ${group.provider}${entry.grant.deviceId === void 0 ? "" : ` \u2192 ${peerName(entry.grant.deviceId)}`}`,
4552
+ // Edit = prefill the form from this grant and drop the saved
4553
+ // entry; saving the form writes the edited rule back.
4554
+ onClick: () => {
4555
+ setGrantAnyDevice(entry.grant.deviceId === void 0), setGrantDevices(entry.grant.deviceId === void 0 ? [] : [entry.grant.deviceId]), entry.grant.models.length === 0 ? (setGrantAllOfProvider([group.provider]), setGrantSelectedModels([])) : (setGrantAllOfProvider([]), setGrantSelectedModels(entry.grant.models.map((model) => `${group.provider}::${model}`))), removeGrant(entry.index), setEditingGrant(!0);
4556
+ }
4557
+ }, t("modelShareEdit")),
4512
4558
  React.createElement("button", {
4513
4559
  type: "button",
4514
4560
  className: "dshRemoteAcpRemoveBtn",
4515
4561
  disabled,
4516
- "aria-label": t("modelShareRemove"),
4517
- onClick: () => removeGrant(index)
4562
+ "aria-label": `${t("modelShareRemove")}: ${group.provider}${entry.grant.deviceId === void 0 ? "" : ` \u2192 ${peerName(entry.grant.deviceId)}`}`,
4563
+ onClick: () => removeGrant(entry.index)
4518
4564
  }, t("modelShareRemove"))
4519
4565
  )
4520
- )
4566
+ ))
4521
4567
  )),
4522
4568
  host.grants.length === 0 ? React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareNoGrants")) : null,
4523
4569
  React.createElement(
@@ -4526,52 +4572,99 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4526
4572
  React.createElement(
4527
4573
  "div",
4528
4574
  { className: "dshRemoteAcpAddInputs" },
4529
- React.createElement(
4530
- "select",
4531
- {
4532
- value: grantProvider,
4533
- disabled,
4534
- "aria-label": t("modelShareProvider"),
4535
- onChange: (event) => setGrantProvider(event.target.value)
4536
- },
4537
- React.createElement("option", { value: "" }, t("modelShareSelectProvider")),
4538
- ...view.localProviders.map((provider) => React.createElement("option", {
4539
- key: provider.id,
4540
- value: provider.id
4541
- }, provider.name ?? provider.id))
4542
- ),
4543
- React.createElement("input", {
4544
- type: "text",
4545
- value: grantModels,
4546
- disabled,
4547
- placeholder: t("modelShareSelectModels"),
4548
- "aria-label": t("modelShareModels"),
4549
- onChange: (event) => setGrantModels(event.target.value)
4550
- }),
4551
4575
  React.createElement("button", {
4552
4576
  type: "button",
4553
4577
  className: "dshRemoteAcpAddTrigger",
4554
- disabled: disabled || grantProvider === "",
4578
+ disabled: disabled || grantSelectedModels.length === 0 && grantAllOfProvider.length === 0,
4555
4579
  onClick: addGrant
4556
- }, t("modelShareAddGrant"))
4580
+ }, t(editingGrant ? "modelShareSaveEdit" : "modelShareAddGrant")),
4581
+ editingGrant ? React.createElement("button", {
4582
+ type: "button",
4583
+ className: "dshRemoteAcpAddTrigger",
4584
+ disabled,
4585
+ onClick: resetGrantForm
4586
+ }, t("cancelServiceAddressEdit")) : null
4557
4587
  ),
4588
+ // One flat picker: every provider's models, grouped under provider
4589
+ // headings, all selectable in a single pass. A provider heading row
4590
+ // checks all of that provider's models at once.
4558
4591
  React.createElement(
4559
- "p",
4560
- { className: "dshRemoteAcpDiag" },
4561
- `${t("modelShareDevice")}: `,
4592
+ "details",
4593
+ { className: "dshRemoteModelSharePicker" },
4594
+ React.createElement("summary", null, modelSummaryLine),
4562
4595
  React.createElement(
4563
- "select",
4564
- {
4565
- value: grantDevice,
4566
- disabled,
4567
- "aria-label": t("modelShareDevice"),
4568
- onChange: (event) => setGrantDevice(event.target.value)
4569
- },
4570
- React.createElement("option", { value: "" }, t("modelShareAnyDevice")),
4571
- ...view.peers.map((device) => React.createElement("option", {
4572
- key: device.deviceId,
4573
- value: device.deviceId
4574
- }, label(device)))
4596
+ "div",
4597
+ { className: "dshRemoteModelSharePickerList", role: "group", "aria-label": t("modelShareModels") },
4598
+ ...view.localProviders.map((provider) => {
4599
+ let allChecked = grantAllOfProvider.includes(provider.id);
4600
+ return React.createElement(
4601
+ "div",
4602
+ { key: `prov-${provider.id}`, className: "dshRemoteModelShareProviderGroup" },
4603
+ React.createElement(
4604
+ "label",
4605
+ { className: "dshRemoteModelShareProviderHeading" },
4606
+ React.createElement("input", {
4607
+ type: "checkbox",
4608
+ checked: allChecked,
4609
+ disabled,
4610
+ "aria-label": `${t("modelShareAllModels")}: ${provider.name ?? provider.id}`,
4611
+ onChange: () => toggleGrantAllOfProvider(provider.id)
4612
+ }),
4613
+ React.createElement("strong", null, provider.name ?? provider.id)
4614
+ ),
4615
+ ...provider.models.map((model) => {
4616
+ let route = `${provider.id}::${model.id}`;
4617
+ return React.createElement(
4618
+ "label",
4619
+ { key: `model-${route}` },
4620
+ React.createElement("input", {
4621
+ type: "checkbox",
4622
+ checked: allChecked || grantSelectedModels.includes(route),
4623
+ // An "all of this provider" heading supersedes the
4624
+ // individual boxes of that provider.
4625
+ disabled: disabled || allChecked,
4626
+ "aria-label": `${provider.name ?? provider.id} / ${model.name ?? model.id}`,
4627
+ onChange: () => toggleGrantModel(route)
4628
+ }),
4629
+ model.name ?? model.id
4630
+ );
4631
+ })
4632
+ );
4633
+ })
4634
+ )
4635
+ ),
4636
+ // Collapsible multi-device selection; empty means every peer.
4637
+ React.createElement(
4638
+ "details",
4639
+ { className: "dshRemoteModelSharePicker" },
4640
+ React.createElement("summary", null, deviceSummaryLine),
4641
+ React.createElement(
4642
+ "div",
4643
+ { className: "dshRemoteModelSharePickerList", role: "group", "aria-label": t("modelShareDevice") },
4644
+ React.createElement(
4645
+ "label",
4646
+ null,
4647
+ React.createElement("input", {
4648
+ type: "checkbox",
4649
+ checked: grantAnyDevice,
4650
+ disabled,
4651
+ "aria-label": t("modelShareAnyDevice"),
4652
+ onChange: (event) => setGrantAnyDevice(event.target.checked)
4653
+ }),
4654
+ t("modelShareAnyDevice")
4655
+ ),
4656
+ ...view.peers.map((device) => React.createElement(
4657
+ "label",
4658
+ { key: `device-${device.deviceId}` },
4659
+ React.createElement("input", {
4660
+ type: "checkbox",
4661
+ checked: grantDevices.includes(device.deviceId),
4662
+ disabled: disabled || grantAnyDevice,
4663
+ "aria-label": label(device),
4664
+ onChange: () => toggleGrantDevice(device.deviceId)
4665
+ }),
4666
+ label(device)
4667
+ ))
4575
4668
  )
4576
4669
  )
4577
4670
  )
@@ -4579,7 +4672,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4579
4672
  "div",
4580
4673
  { className: "dshRemoteAcpList" },
4581
4674
  ...view.peers.map((device) => {
4582
- let source = borrower.sources[device.deviceId];
4675
+ let source = borrower.sources[device.deviceId], status = borrowStatus(device.deviceId, source);
4583
4676
  return React.createElement(
4584
4677
  "div",
4585
4678
  {
@@ -4592,12 +4685,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4592
4685
  React.createElement(
4593
4686
  "div",
4594
4687
  { className: "dshRemoteAcpRowInfo" },
4595
- React.createElement("strong", { className: "dshRemoteAcpName" }, label(device)),
4596
- React.createElement(
4597
- "p",
4598
- null,
4599
- `${t("modelShareBorrowFrom")} ${device.name} \xB7 ${source?.models.length === 0 || source === void 0 ? t("modelShareAllModels") : source.models.join(", ")}`
4600
- )
4688
+ React.createElement("strong", { className: "dshRemoteAcpName" }, label(device))
4601
4689
  ),
4602
4690
  React.createElement("input", {
4603
4691
  type: "checkbox",
@@ -4609,6 +4697,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4609
4697
  "aria-label": `${t("modelShareBorrowFrom")}: ${label(device)}`,
4610
4698
  onChange: () => toggleSource(device.deviceId, device.name)
4611
4699
  })
4700
+ ),
4701
+ status === void 0 ? null : React.createElement(
4702
+ "p",
4703
+ { className: "dshRemoteAcpDiag" },
4704
+ React.createElement("span", { className: `dshRemoteAcpStatus${status.cls}` }, status.text)
4612
4705
  )
4613
4706
  );
4614
4707
  }),
@@ -4627,7 +4720,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4627
4720
  "div",
4628
4721
  { className: "dshRemoteAcpSummaryText" },
4629
4722
  React.createElement("strong", null, t("modelShareLending")),
4630
- React.createElement("p", null, t("modelSharingHint"))
4723
+ React.createElement("p", null, t("modelShareLendingHint"))
4631
4724
  ),
4632
4725
  React.createElement(
4633
4726
  "span",
@@ -6017,6 +6110,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
6017
6110
  // selectors only add the select / number controls it introduces.
6018
6111
  ".dshRemoteAcpAddInputs select,.dshRemoteAcpRowActions input[type=number]{box-sizing:border-box;min-width:0;height:32px;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);padding:0 10px;font:inherit;font-size:12px}.dshRemoteAcpAddInputs select:focus-visible,.dshRemoteAcpRowActions input[type=number]:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.dshRemoteAcpRowActions input[type=number]{width:72px;text-align:center}",
6019
6112
  ".dshRemoteAcpDiag{margin:0;font-size:12px;line-height:1.45;color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere}.dshRemoteAcpAddTrigger{margin-top:6px;margin-left:8px;align-self:flex-start;color:var(--dsw-alias-label-tertiary)}.dshRemoteAcpAddTrigger:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.dshRemoteAcpAddForm{margin-top:8px;padding:12px 0 2px 16px;border-top:1px solid var(--dsw-alias-border-l3)}.dshRemoteAcpAddInputs{display:grid;grid-template-columns:minmax(90px,.85fr) minmax(130px,1.15fr) minmax(90px,.9fr) auto auto;gap:8px;align-items:center}.dshRemoteAcpAddInputs input{box-sizing:border-box;width:100%;min-width:0;height:32px;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);padding:0 10px;font:inherit;font-size:12px}.dshRemoteAcpAddInputs input:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.dshRemoteAcpAddInputs button{box-sizing:border-box;height:32px;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;background:transparent;color:var(--dsw-alias-label-primary);padding:0 12px;cursor:pointer;font:inherit;font-size:12px;font-weight:500;white-space:nowrap;transition:border-color .15s,background .15s}.dshRemoteAcpAddInputs button.isGhost{border-color:transparent;color:var(--dsw-alias-label-tertiary)}.dshRemoteAcpAddInputs button:hover:not(:disabled){border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-interactive-bg-hover)}.dshRemoteAcpAddInputs button.isGhost:hover:not(:disabled){border-color:transparent;color:var(--dsw-alias-label-primary)}.dshRemoteAcpAddInputs button:disabled{opacity:.45;cursor:default}@media(prefers-reduced-motion:reduce){.dshRemoteAcpChevron{transition:none}}",
6113
+ // [model-sharing] Collapsible checkbox pickers and grant rows inside the
6114
+ // model-share settings section; everything else reuses dshRemoteAcp*.
6115
+ '.dshRemoteModelSharePicker{margin:8px 0 0 8px;font-size:12px;color:var(--dsw-alias-label-tertiary)}.dshRemoteModelSharePicker>summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;user-select:none;color:var(--dsw-alias-label-secondary);line-height:1.45;overflow-wrap:anywhere}.dshRemoteModelSharePicker>summary::-webkit-details-marker{display:none}.dshRemoteModelSharePicker>summary::before{content:"\u25B8";font-size:10px;transition:transform .15s ease-out}.dshRemoteModelSharePicker[open]>summary::before{transform:rotate(90deg)}.dshRemoteModelSharePicker>summary:hover{color:var(--dsw-alias-label-primary)}.dshRemoteModelSharePickerList{display:flex;flex-direction:column;gap:4px;margin:8px 0 0;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;background:var(--dsw-alias-bg-layer-3);max-height:180px;overflow-y:auto}.dshRemoteModelSharePickerList label{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px;line-height:1.4;color:var(--dsw-alias-label-primary);cursor:pointer;overflow-wrap:anywhere}.dshRemoteModelSharePickerList input[type=checkbox]{flex:0 0 auto;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dshRemoteModelSharePickerList input[type=checkbox]:disabled{cursor:default;opacity:.5}.dshRemoteModelSharePickerList label:has(input:disabled){color:var(--dsw-alias-label-tertiary)}.dshRemoteModelShareGrantEntry{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 0 8px;font-size:12px;line-height:1.45;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}.dshRemoteModelShareGrantEntry>span{min-width:0}.dshRemoteModelShareGrantEntry .dshRemoteAcpRemoveBtn{flex:0 0 auto}@media(prefers-reduced-motion:reduce){.dshRemoteModelSharePicker>summary::before{transition:none}}',
6020
6116
  ".dshRemoteCancelWorkspace{min-height:36px;border:0;background:transparent;color:var(--dsw-alias-label-secondary);padding:6px 0;cursor:pointer}.dshRemoteCancelWorkspace:hover:not(:disabled){color:var(--dsw-alias-label-primary);text-decoration:underline}.dshRemoteCancelWorkspace:disabled{opacity:.5;cursor:default}",
6021
6117
  ".dshRemoteHostLoading{display:flex;align-items:center;justify-content:center;gap:8px;position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap;color:var(--dsw-alias-label-secondary)}",
6022
6118
  '.dshRemoteHostList{display:flex;flex-direction:column;border-top:1px solid var(--dsw-alias-border-l2);max-height:296px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.dshRemoteHostList.isCollapsed{max-height:none;overflow-y:visible}.dshRemoteHostList>button{min-height:58px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;border:0;border-bottom:1px solid var(--dsw-alias-border-l2);background:transparent;padding:10px 20px 10px 4px;cursor:pointer}.dshRemoteHostList>button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dshRemoteHostList>button:disabled{opacity:.5;cursor:default}.dshRemoteHostList>button[aria-current="true"]{background:var(--dsw-alias-interactive-bg-hover)}.dshRemoteHostList>button>span{min-width:0;display:flex;flex-direction:column;gap:3px}.dshRemoteHostList>button strong{font-size:14px;font-weight:500}.dshRemoteHostList small{color:var(--dsw-alias-label-secondary);font-size:12px}',
package/dist/index.js CHANGED
@@ -75383,7 +75383,7 @@ function parseIpv6(value) {
75383
75383
  }
75384
75384
 
75385
75385
  // packages/plugin/src/version.ts
75386
- var PLUGIN_VERSION = "0.6.12";
75386
+ var PLUGIN_VERSION = "0.6.14";
75387
75387
 
75388
75388
  // packages/plugin/src/server-api.ts
75389
75389
  var TERMINAL_CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f]/u;
@@ -114779,12 +114779,13 @@ var PluginControlRuntime = class {
114779
114779
  })));
114780
114780
  }
114781
114781
  async modelShareGet() {
114782
- const { store, llm } = this.modelShareBinding();
114782
+ const { store, llm, describe: describe3 } = this.modelShareBinding();
114783
114783
  const policy = await store.read();
114784
114784
  return {
114785
114785
  store: policy,
114786
114786
  peers: await this.modelSharePeers(policy),
114787
114787
  localProviders: await this.modelShareCatalog(llm),
114788
+ borrowerDiagnostics: this.modelShareDiagnostics(describe3),
114788
114789
  writable: this.settings !== void 0
114789
114790
  };
114790
114791
  }
@@ -114799,9 +114800,23 @@ var PluginControlRuntime = class {
114799
114800
  store: next,
114800
114801
  peers: await this.modelSharePeers(next),
114801
114802
  localProviders: await this.modelShareCatalog(binding.llm),
114803
+ borrowerDiagnostics: this.modelShareDiagnostics(binding.describe),
114802
114804
  writable: this.settings !== void 0
114803
114805
  };
114804
114806
  }
114807
+ /** Borrow-side sync diagnostics; defaults keep the view shape stable. */
114808
+ modelShareDiagnostics(describe3) {
114809
+ if (describe3 === void 0) return { syncAvailable: false, sources: [] };
114810
+ try {
114811
+ const described = describe3();
114812
+ return {
114813
+ syncAvailable: described.syncAvailable === true,
114814
+ sources: Array.isArray(described.sources) ? described.sources : []
114815
+ };
114816
+ } catch {
114817
+ return { syncAvailable: false, sources: [] };
114818
+ }
114819
+ }
114805
114820
  // [model-sharing] END
114806
114821
  currentEditableConfig() {
114807
114822
  if (this.settings === void 0) return editableConfig(this.config);
@@ -122698,13 +122713,15 @@ var ModelShareHost = class {
122698
122713
  const id7 = routeKey(grant.provider, resolved.id);
122699
122714
  if (seen.has(id7)) continue;
122700
122715
  seen.add(id7);
122716
+ const contextWindow = resolved.context?.contextWindow ?? resolved.contextWindow;
122717
+ const maxTokens = resolved.defaultMaxTokens ?? resolved.maxTokens;
122701
122718
  const parsed = sharedModelSchema.safeParse({
122702
122719
  id: id7,
122703
122720
  provider: grant.provider,
122704
122721
  model: resolved.id,
122705
122722
  name: resolved.name ?? resolved.id,
122706
- ...resolved.contextWindow === void 0 ? {} : { contextWindow: resolved.contextWindow },
122707
- ...resolved.maxTokens === void 0 ? {} : { maxTokens: resolved.maxTokens },
122723
+ ...contextWindow === void 0 ? {} : { contextWindow },
122724
+ ...maxTokens === void 0 ? {} : { maxTokens },
122708
122725
  ...resolved.reasoning?.efforts === void 0 ? {} : { reasoningEfforts: resolved.reasoning.efforts.map((effort) => effort.id) },
122709
122726
  ...resolved.inputModalities === void 0 ? {} : { inputModalities: [...resolved.inputModalities] }
122710
122727
  });
@@ -126883,6 +126900,7 @@ var RemoteModelAdapter = class extends LlmAdapter {
126883
126900
  async *stream(options) {
126884
126901
  const route = this.resolveRoute(options.model);
126885
126902
  if (route === void 0) {
126903
+ this.transport.onStale?.("model-missing");
126886
126904
  yield failureChunk("NO_ADAPTER", `The lending Host no longer advertises model "${options.model}".`);
126887
126905
  return;
126888
126906
  }
@@ -126899,6 +126917,7 @@ var RemoteModelAdapter = class extends LlmAdapter {
126899
126917
  ...options.reasoningEffort === void 0 ? {} : { reasoningEffort: options.reasoningEffort }
126900
126918
  });
126901
126919
  } catch (error62) {
126920
+ this.transport.onStale?.("model-missing");
126902
126921
  yield failureChunk(
126903
126922
  "NO_ADAPTER",
126904
126923
  error62 instanceof Error ? `The lending Host rejected the request: ${error62.message}` : "The lending Host rejected the request."
@@ -126924,6 +126943,7 @@ var RemoteModelAdapter = class extends LlmAdapter {
126924
126943
  try {
126925
126944
  batch = await this.transport.drain(streamId, 2e4);
126926
126945
  } catch (error62) {
126946
+ this.transport.onStale?.("connection-failed");
126927
126947
  yield failureChunk(
126928
126948
  "HTTP_502",
126929
126949
  error62 instanceof Error ? `The lending Host connection failed: ${error62.message}` : "The lending Host connection failed."
@@ -126961,6 +126981,8 @@ var BorrowerRuntime = class {
126961
126981
  this.logger = logger2;
126962
126982
  }
126963
126983
  registered = /* @__PURE__ */ new Map();
126984
+ /** Last sync outcome per Host, for the settings status line. */
126985
+ states = /* @__PURE__ */ new Map();
126964
126986
  closed = false;
126965
126987
  /**
126966
126988
  * Refresh one Host: ask what it lends, apply this machine's own selection,
@@ -126974,6 +126996,7 @@ var BorrowerRuntime = class {
126974
126996
  const { borrower } = await this.store.read();
126975
126997
  const source = borrower.sources[hostId];
126976
126998
  if (source === void 0 || !source.enabled) {
126999
+ this.states.set(hostId, { outcome: "disabled" });
126977
127000
  this.unregister(hostId);
126978
127001
  return;
126979
127002
  }
@@ -126981,6 +127004,7 @@ var BorrowerRuntime = class {
126981
127004
  try {
126982
127005
  const listed = await transport.list();
126983
127006
  if (!listed.enabled) {
127007
+ this.states.set(hostId, { outcome: "host-disabled" });
126984
127008
  this.unregister(hostId);
126985
127009
  return;
126986
127010
  }
@@ -126990,6 +127014,7 @@ var BorrowerRuntime = class {
126990
127014
  hostId,
126991
127015
  reason: error62 instanceof Error ? error62.name : "unknown"
126992
127016
  });
127017
+ this.states.set(hostId, { outcome: "failed", error: error62 instanceof Error ? error62.message : String(error62) });
126993
127018
  this.unregister(hostId);
126994
127019
  return;
126995
127020
  }
@@ -127016,11 +127041,13 @@ var BorrowerRuntime = class {
127016
127041
  const source = borrower.sources[hostId];
127017
127042
  const providerId = providerIdForHost(hostId);
127018
127043
  if (source === void 0 || !source.enabled) {
127044
+ this.states.set(hostId, { outcome: "disabled" });
127019
127045
  this.unregister(hostId);
127020
127046
  return;
127021
127047
  }
127022
127048
  const selected = source.models.length === 0 ? models : models.filter((entry) => source.models.includes(entry.id));
127023
127049
  if (selected.length === 0) {
127050
+ this.states.set(hostId, { outcome: "no-models" });
127024
127051
  this.unregister(hostId);
127025
127052
  return;
127026
127053
  }
@@ -127028,6 +127055,7 @@ var BorrowerRuntime = class {
127028
127055
  if (existing !== void 0) {
127029
127056
  existing.holder.models = [...selected];
127030
127057
  existing.models = existing.holder.models;
127058
+ this.states.set(hostId, { outcome: "registered" });
127031
127059
  return;
127032
127060
  }
127033
127061
  const holder = { models: [...selected] };
@@ -127045,6 +127073,7 @@ var BorrowerRuntime = class {
127045
127073
  try {
127046
127074
  const handle = this.llm.registerAdapter([providerId], adapter);
127047
127075
  this.registered.set(hostId, { handle, models: holder.models, holder });
127076
+ this.states.set(hostId, { outcome: "registered" });
127048
127077
  this.logger?.info("model-share: borrower provider registered", {
127049
127078
  hostId,
127050
127079
  providerId,
@@ -127056,6 +127085,10 @@ var BorrowerRuntime = class {
127056
127085
  providerId,
127057
127086
  reason: error62 instanceof Error ? error62.message : "unknown"
127058
127087
  });
127088
+ this.states.set(hostId, {
127089
+ outcome: "failed",
127090
+ error: error62 instanceof Error ? error62.message : String(error62)
127091
+ });
127059
127092
  }
127060
127093
  }
127061
127094
  /** Withdraw one Host's provider. Safe to call when nothing is registered. */
@@ -127072,12 +127105,33 @@ var BorrowerRuntime = class {
127072
127105
  /** Withdraw everything; used on plugin unload. */
127073
127106
  close() {
127074
127107
  this.closed = true;
127108
+ this.states.clear();
127075
127109
  for (const hostId of [...this.registered.keys()]) this.unregister(hostId);
127076
127110
  }
127077
127111
  /** Hosts currently exposed in the local selector. */
127078
127112
  activeHosts() {
127079
127113
  return [...this.registered.keys()];
127080
127114
  }
127115
+ /**
127116
+ * Diagnostic snapshot for the settings UI: one entry per Host this runtime
127117
+ * has observed, covering both the latest sync outcome and what is currently
127118
+ * registered. Never throws; used read-only by `modelshare.get`.
127119
+ */
127120
+ describeBorrower() {
127121
+ const hostIds = /* @__PURE__ */ new Set([...this.registered.keys(), ...this.states.keys()]);
127122
+ return [...hostIds].map((hostId) => {
127123
+ const existing = this.registered.get(hostId);
127124
+ const state2 = this.states.get(hostId);
127125
+ const outcome = state2?.outcome ?? (existing !== void 0 ? "registered" : "disabled");
127126
+ return {
127127
+ hostId,
127128
+ registered: existing !== void 0,
127129
+ modelCount: existing?.models.length ?? 0,
127130
+ outcome,
127131
+ ...state2?.error === void 0 ? {} : { error: state2.error }
127132
+ };
127133
+ });
127134
+ }
127081
127135
  };
127082
127136
 
127083
127137
  // packages/plugin/src/model-share/policy.ts
@@ -128458,6 +128512,7 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128458
128512
  let controlRuntime;
128459
128513
  const modelShareBorrowers = [];
128460
128514
  let borrowerSync;
128515
+ let borrowerSyncOnStale;
128461
128516
  let modelShareStore;
128462
128517
  try {
128463
128518
  const nativeTypertGateway = ctx.get("typertGateway");
@@ -128554,20 +128609,41 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128554
128609
  const borrower = new BorrowerRuntime(llmRegistry, activeStore, logger2);
128555
128610
  modelShareBorrowers.push(borrower);
128556
128611
  const clientRuntimeForSync = nextClientRuntime;
128612
+ const SYNC_OK_MS = 6e4;
128613
+ const SYNC_RETRY_MS = 15e3;
128614
+ const lastSyncAt = /* @__PURE__ */ new Map();
128615
+ const lastSyncOk = /* @__PURE__ */ new Map();
128557
128616
  const syncBorrowed = async () => {
128558
128617
  if (closed) return;
128559
128618
  const { borrower: policy } = await activeStore.read();
128560
128619
  for (const hostId of borrower.activeHosts()) {
128561
- if (policy.sources[hostId]?.enabled !== true) borrower.unregister(hostId);
128620
+ if (policy.sources[hostId]?.enabled !== true) {
128621
+ borrower.unregister(hostId);
128622
+ lastSyncAt.delete(hostId);
128623
+ lastSyncOk.delete(hostId);
128624
+ }
128562
128625
  }
128626
+ const now = Date.now();
128563
128627
  for (const [hostId, source] of Object.entries(policy.sources)) {
128564
128628
  if (!source.enabled) continue;
128629
+ const elapsed = now - (lastSyncAt.get(hostId) ?? 0);
128630
+ if (elapsed < (lastSyncOk.get(hostId) === false ? SYNC_RETRY_MS : SYNC_OK_MS)) continue;
128631
+ lastSyncAt.set(hostId, now);
128565
128632
  const deviceName = source.hostName ?? hostId;
128566
128633
  const transport = clientRuntimeForSync.createModelShareTransport(hostId, deviceName);
128634
+ const before = borrower.activeHosts().includes(hostId);
128567
128635
  await borrower.refresh(hostId, deviceName, {
128568
128636
  ...transport,
128569
- list: () => clientRuntimeForSync.listSharedModels(hostId)
128570
- }).catch(() => void 0);
128637
+ list: () => clientRuntimeForSync.listSharedModels(hostId),
128638
+ onStale: (reason) => {
128639
+ logger2.info("model-share: stale catalog detected", { hostId, reason });
128640
+ borrowerSyncOnStale?.(hostId);
128641
+ }
128642
+ }).then(() => {
128643
+ lastSyncOk.set(hostId, borrower.activeHosts().includes(hostId) || before);
128644
+ }).catch(() => {
128645
+ lastSyncOk.set(hostId, false);
128646
+ });
128571
128647
  }
128572
128648
  };
128573
128649
  void syncBorrowed();
@@ -128575,6 +128651,23 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128575
128651
  activeStore.watch(() => {
128576
128652
  void syncBorrowed();
128577
128653
  });
128654
+ const syncTimer = setInterval(() => {
128655
+ void syncBorrowed();
128656
+ }, SYNC_OK_MS);
128657
+ syncTimer.unref?.();
128658
+ const previousDispose = borrower.close.bind(borrower);
128659
+ borrower.close = () => {
128660
+ clearInterval(syncTimer);
128661
+ previousDispose();
128662
+ };
128663
+ const staleHosts = /* @__PURE__ */ new Set();
128664
+ borrowerSyncOnStale = (hostId) => {
128665
+ if (staleHosts.has(hostId)) return;
128666
+ staleHosts.add(hostId);
128667
+ lastSyncAt.set(hostId, 0);
128668
+ lastSyncOk.set(hostId, false);
128669
+ void syncBorrowed().finally(() => staleHosts.delete(hostId));
128670
+ };
128578
128671
  }
128579
128672
  return { runtime: nextRuntime, clientRuntime: nextClientRuntime };
128580
128673
  };
@@ -128649,10 +128742,18 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128649
128742
  logStore,
128650
128743
  // [model-sharing] Lazy binding so server switches recreate the store
128651
128744
  // and the borrower providers can be resynced after a policy edit.
128745
+ // `describe` reports per-source borrow diagnostics: without a client
128746
+ // runtime the sync can never run, which the settings UI must surface.
128652
128747
  () => modelShareStore === void 0 ? void 0 : {
128653
128748
  store: modelShareStore,
128654
128749
  llm: ctx.get("llm", false),
128655
- resync: () => borrowerSync?.() ?? Promise.resolve()
128750
+ resync: () => borrowerSync?.() ?? Promise.resolve(),
128751
+ describe: () => ({
128752
+ // A ClientModeRuntime is the prerequisite for the borrower sync
128753
+ // transport; without it borrowed models can never appear.
128754
+ syncAvailable: clientRuntime !== void 0,
128755
+ sources: modelShareBorrowers.flatMap((borrower) => borrower.describeBorrower())
128756
+ })
128656
128757
  }
128657
128758
  );
128658
128759
  if (initialStorageError !== void 0) {
package/dsh-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
3
  "id": "com.r2049.ds-harness-remote",
4
4
  "name": "@musdrop/ds-harness-remote",
5
- "version": "0.6.12",
5
+ "version": "0.6.14",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
@@ -1,19 +1,19 @@
1
- > [!IMPORTANT]
2
- > ## This is a fork, not the original
3
- >
4
- > This plugin (`@musdrop/ds-harness-remote`) is a fork of [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) adding **cross-device model lending/borrowing** on top of everything below:
5
- >
6
- > - **Lend**: share this machine's configured models with other devices. Requests are re-driven locally with this machine's own credentials — the borrower never sees any secret, but every call spends this machine's quota.
7
- > - **Borrow**: use models another device lends; they appear in the local model picker under that device's **name** as the provider.
8
- > - **Two-sided grants**: the lender picks providers/devices and models; the borrower opts in per device. Only models allowed on both sides show up.
9
- > - Configuration lives in this plugin's detail page, in the new **"Model sharing" section**.
10
- >
11
- > **⚠️ Not coinstallable with the original**: the plugin shares the original's id (`com.r2049.ds-harness-remote`), so a profile can hold only one of the two. The shared id also means this fork **replaces** the original seamlessly — existing Remote configuration and sign-in carry over. Model-sharing policy is stored in a separate `model-share.json`.
12
- >
13
- > The original feature tour follows.
14
-
15
- ---
16
-
1
+ > [!IMPORTANT]
2
+ > ## This is a fork, not the original
3
+ >
4
+ > This plugin (`@musdrop/ds-harness-remote`) is a fork of [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) adding **cross-device model lending/borrowing** on top of everything below:
5
+ >
6
+ > - **Lend**: share this machine's configured models with other devices. Requests are re-driven locally with this machine's own credentials — the borrower never sees any secret, but every call spends this machine's quota.
7
+ > - **Borrow**: use models another device lends; they appear in the local model picker under that device's **name** as the provider.
8
+ > - **Two-sided grants**: the lender picks providers/devices and models; the borrower opts in per device. Only models allowed on both sides show up.
9
+ > - Configuration lives in this plugin's detail page, in the new **"Model sharing" section**.
10
+ >
11
+ > **⚠️ Not coinstallable with the original**: the plugin shares the original's id (`com.r2049.ds-harness-remote`), so a profile can hold only one of the two. The shared id also means this fork **replaces** the original seamlessly — existing Remote configuration and sign-in carry over. Model-sharing policy is stored in a separate `model-share.json`.
12
+ >
13
+ > The original feature tour follows.
14
+
15
+ ---
16
+
17
17
  # DS Harness Remote
18
18
 
19
19
  [Website](https://dsh.r2049.cn/) · [Web client](https://dsh.r2049.cn/app) · [iOS beta](https://github.com/liguobao/ds-harness-remote/issues/20) · [Android download](https://github.com/liguobao/ds-harness-remote/releases/latest)
@@ -1,19 +1,19 @@
1
- > [!IMPORTANT]
2
- > ## これはフォーク版です(原版ではありません)
3
- >
4
- > 本プラグイン(`@musdrop/ds-harness-remote`)は [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) のフォークで、既存の全機能に加えて**デバイス間モデル貸借**を追加しています:
5
- >
6
- > - **貸出(Lend)**:このマシンが設定済みのモデルを他デバイスに貸し出します。リクエストはこのマシンが自身の資格情報で代行し、相手に秘密情報は渡りませんが、消費されるのはこのマシンのクォータです。
7
- > - **借用(Borrow)**:他デバイスが貸し出したモデルを利用でき、選択器には相手の**デバイス名**をプロバイダーとして表示されます。
8
- > - **双方向の許可**:貸し手はプロバイダー/デバイス/モデルを指定し、借り手はデバイスごとに有効化します。双方が許可したモデルのみ表示されます。
9
- > - 設定は本プラグインの詳細ページにある**「モデル共有」セクション**で行います。
10
- >
11
- > **⚠️ 原版との併用不可**:原版 `ds-harness-remote` と同じプラグイン ID を持つため、同一 profile にはどちらか一方のみ。同 ID であるため、このフォークは原版をシームレスに**置き換え**でき、既存の Remote 設定とサインイン状態はそのまま引き継がれます。
12
- >
13
- > 以下は原版の機能紹介です。
14
-
15
- ---
16
-
1
+ > [!IMPORTANT]
2
+ > ## これはフォーク版です(原版ではありません)
3
+ >
4
+ > 本プラグイン(`@musdrop/ds-harness-remote`)は [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) のフォークで、既存の全機能に加えて**デバイス間モデル貸借**を追加しています:
5
+ >
6
+ > - **貸出(Lend)**:このマシンが設定済みのモデルを他デバイスに貸し出します。リクエストはこのマシンが自身の資格情報で代行し、相手に秘密情報は渡りませんが、消費されるのはこのマシンのクォータです。
7
+ > - **借用(Borrow)**:他デバイスが貸し出したモデルを利用でき、選択器には相手の**デバイス名**をプロバイダーとして表示されます。
8
+ > - **双方向の許可**:貸し手はプロバイダー/デバイス/モデルを指定し、借り手はデバイスごとに有効化します。双方が許可したモデルのみ表示されます。
9
+ > - 設定は本プラグインの詳細ページにある**「モデル共有」セクション**で行います。
10
+ >
11
+ > **⚠️ 原版との併用不可**:原版 `ds-harness-remote` と同じプラグイン ID を持つため、同一 profile にはどちらか一方のみ。同 ID であるため、このフォークは原版をシームレスに**置き換え**でき、既存の Remote 設定とサインイン状態はそのまま引き継がれます。
12
+ >
13
+ > 以下は原版の機能紹介です。
14
+
15
+ ---
16
+
17
17
  # DS Harness Remote
18
18
 
19
19
  [公式サイト](https://dsh.r2049.cn/) · [Web クライアント](https://dsh.r2049.cn/app) · [iOS ベータ](https://github.com/liguobao/ds-harness-remote/issues/20) · [Android ダウンロード](https://github.com/liguobao/ds-harness-remote/releases/latest)
@@ -1,19 +1,19 @@
1
- > [!IMPORTANT]
2
- > ## Это форк, а не оригинал
3
- >
4
- > Этот плагин (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), добавляющий **предоставление и заимствование моделей между устройствами** поверх всех функций ниже:
5
- >
6
- > - **Предоставление**: этот компьютер отдаёт свои настроенные модели другим устройствам. Запросы выполняются локально с собственными учётными данными — заёмщик не видит секретов, но расходуется квота этого компьютера.
7
- > - **Заимствование**: модели, предоставленные другими устройствами, появляются в локальном выборе моделей под **именем устройства** как провайдером.
8
- > - **Двусторонние правила**: владелец задаёт провайдеров/устройства и модели, заёмщик включают по устройствам. Показываются только модели, разрешённые с обеих сторон.
9
- > - Настройки — в карточке этого плагина, в новом разделе **«Обмен моделями»**.
10
- >
11
- > **⚠️ Нельзя устанавливать вместе с оригиналом**: у плагина тот же идентификатор, что у `ds-harness-remote`, поэтому в профиле может стоять только один из них. Общий идентификатор также означает, что форк **заменяет** оригинал без потерь — существующие настройки Remote и вход в аккаунт сохраняются.
12
- >
13
- > Ниже — описание оригинальных функций.
14
-
15
- ---
16
-
1
+ > [!IMPORTANT]
2
+ > ## Это форк, а не оригинал
3
+ >
4
+ > Этот плагин (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), добавляющий **предоставление и заимствование моделей между устройствами** поверх всех функций ниже:
5
+ >
6
+ > - **Предоставление**: этот компьютер отдаёт свои настроенные модели другим устройствам. Запросы выполняются локально с собственными учётными данными — заёмщик не видит секретов, но расходуется квота этого компьютера.
7
+ > - **Заимствование**: модели, предоставленные другими устройствами, появляются в локальном выборе моделей под **именем устройства** как провайдером.
8
+ > - **Двусторонние правила**: владелец задаёт провайдеров/устройства и модели, заёмщик включают по устройствам. Показываются только модели, разрешённые с обеих сторон.
9
+ > - Настройки — в карточке этого плагина, в новом разделе **«Обмен моделями»**.
10
+ >
11
+ > **⚠️ Нельзя устанавливать вместе с оригиналом**: у плагина тот же идентификатор, что у `ds-harness-remote`, поэтому в профиле может стоять только один из них. Общий идентификатор также означает, что форк **заменяет** оригинал без потерь — существующие настройки Remote и вход в аккаунт сохраняются.
12
+ >
13
+ > Ниже — описание оригинальных функций.
14
+
15
+ ---
16
+
17
17
  # DS Harness Remote
18
18
 
19
19
  [Сайт](https://dsh.r2049.cn/) · [Веб-клиент](https://dsh.r2049.cn/app) · [Бета для iOS](https://github.com/liguobao/ds-harness-remote/issues/20) · [Скачать для Android](https://github.com/liguobao/ds-harness-remote/releases/latest)
@@ -1,19 +1,19 @@
1
- > [!IMPORTANT]
2
- > ## Це форк, а не оригінал
3
- >
4
- > Цей плагін (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), що додає **надання та позичання моделей між пристроями** поверх усіх функцій нижче:
5
- >
6
- > - **Надання**: цей комп'ютер віддає свої налаштовані моделі іншим пристроям. Запити виконуються локально з власними обліковими даними — позичальник не бачить секретів, але витрачається квота цього комп'ютера.
7
- > - **Позичання**: моделі, надані іншими пристроями, з'являються в локальному виборі моделей під **іменем пристрою** як провайдером.
8
- > - **Двосторонні правила**: власник задає провайдерів/пристрої та моделі, позичальник вмикає за пристроями. Показуються лише моделі, дозволені з обох боків.
9
- > - Налаштування — в картці цього плагіна, в новому розділі **«Модельний обмін»**.
10
- >
11
- > **⚠️ Не можна встановлювати разом з оригіналом**: у плагіна той самий ідентифікатор, що й у `ds-harness-remote`, тож у профілі може бути лише один з них. Спільний ідентифікатор також означає, що форк **замінює** оригінал без втрат — наявні налаштування Remote та вхід в акаунт зберігаються.
12
- >
13
- > Нижче — опис оригінальних функцій.
14
-
15
- ---
16
-
1
+ > [!IMPORTANT]
2
+ > ## Це форк, а не оригінал
3
+ >
4
+ > Цей плагін (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), що додає **надання та позичання моделей між пристроями** поверх усіх функцій нижче:
5
+ >
6
+ > - **Надання**: цей комп'ютер віддає свої налаштовані моделі іншим пристроям. Запити виконуються локально з власними обліковими даними — позичальник не бачить секретів, але витрачається квота цього комп'ютера.
7
+ > - **Позичання**: моделі, надані іншими пристроями, з'являються в локальному виборі моделей під **іменем пристрою** як провайдером.
8
+ > - **Двосторонні правила**: власник задає провайдерів/пристрої та моделі, позичальник вмикає за пристроями. Показуються лише моделі, дозволені з обох боків.
9
+ > - Налаштування — в картці цього плагіна, в новому розділі **«Модельний обмін»**.
10
+ >
11
+ > **⚠️ Не можна встановлювати разом з оригіналом**: у плагіна той самий ідентифікатор, що й у `ds-harness-remote`, тож у профілі може бути лише один з них. Спільний ідентифікатор також означає, що форк **замінює** оригінал без втрат — наявні налаштування Remote та вхід в акаунт зберігаються.
12
+ >
13
+ > Нижче — опис оригінальних функцій.
14
+
15
+ ---
16
+
17
17
  # DS Harness Remote
18
18
 
19
19
  [Сайт](https://dsh.r2049.cn/) · [Вебклієнт](https://dsh.r2049.cn/app) · [Бета для iOS](https://github.com/liguobao/ds-harness-remote/issues/20) · [Завантажити для Android](https://github.com/liguobao/ds-harness-remote/releases/latest)
@@ -1,19 +1,19 @@
1
- > [!IMPORTANT]
2
- > ## 这是一个 fork,不是原版
3
- >
4
- > 本插件(`@musdrop/ds-harness-remote`)是 [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) 的 fork,在原有全部功能之上新增了**跨设备模型借出/借用**:
5
- >
6
- > - **借出**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
7
- > - **借用**:借用其它设备借出的模型,借到的模型以对方**设备名**作为提供商出现在本机模型选择器中。
8
- > - **双向授权**:借出方按提供商/设备配置允许借出的模型,借用方按设备决定是否启用;两边都同意的模型才会出现。
9
- > - 配置入口:本插件详情页下方新增的**「模型共享」区块**。
10
- >
11
- > **⚠️ 与原版不能同时安装**:本插件与原版 `ds-harness-remote` 使用相同插件 ID,同一 profile 只能装其一。同 ID 也意味着本插件可直接**替换**原版,原有 Remote 配置与登录状态无缝继承。模型共享的授权配置存在独立的 `model-share.json`,不影响原版配置字段。
12
- >
13
- > 以下为原版功能介绍。
14
-
15
- ---
16
-
1
+ > [!IMPORTANT]
2
+ > ## 这是一个 fork,不是原版
3
+ >
4
+ > 本插件(`@musdrop/ds-harness-remote`)是 [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) 的 fork,在原有全部功能之上新增了**跨设备模型借出/借用**:
5
+ >
6
+ > - **借出**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
7
+ > - **借用**:借用其它设备借出的模型,借到的模型以对方**设备名**作为提供商出现在本机模型选择器中。
8
+ > - **双向授权**:借出方按提供商/设备配置允许借出的模型,借用方按设备决定是否启用;两边都同意的模型才会出现。
9
+ > - 配置入口:本插件详情页下方新增的**「模型共享」区块**。
10
+ >
11
+ > **⚠️ 与原版不能同时安装**:本插件与原版 `ds-harness-remote` 使用相同插件 ID,同一 profile 只能装其一。同 ID 也意味着本插件可直接**替换**原版,原有 Remote 配置与登录状态无缝继承。模型共享的授权配置存在独立的 `model-share.json`,不影响原版配置字段。
12
+ >
13
+ > 以下为原版功能介绍。
14
+
15
+ ---
16
+
17
17
  # DS Harness Remote
18
18
 
19
19
  [官方网站](https://dsh.r2049.cn/) · [Web 客户端](https://dsh.r2049.cn/app) · [iOS 内测](https://github.com/liguobao/ds-harness-remote/issues/20) · [Android 下载](https://github.com/liguobao/ds-harness-remote/releases/latest)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musdrop/ds-harness-remote",
3
- "version": "0.6.12",
3
+ "version": "0.6.14",
4
4
  "description": "P2P-based, end-to-end encrypted remote access to DeepSeek Harness, CodeX, Claude Code, Pi, and other workspaces from web and mobile clients. Fork adding cross-device model lending/borrowing.",
5
5
  "keywords": [
6
6
  "deepseek",