@musdrop/ds-harness-remote 0.6.17 → 0.6.20
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 +22 -23
- package/dist/client.js +23 -5
- package/dist/index.js +102 -62
- package/dsh-plugin.json +1 -1
- package/locale/README.en.md +12 -13
- package/locale/README.ja.md +12 -13
- package/locale/README.ru.md +12 -13
- package/locale/README.uk.md +12 -13
- package/locale/README.zh.md +12 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
> 以下为原版 README。原有功能(远程工作区、会话接管、终端、文件上传下载、CodeX/ACP 等)在本包中全部可用。
|
|
1
|
+
# 这是一个 fork,不是原版
|
|
2
|
+
|
|
3
|
+
本包 [`@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,在原有全部功能之上新增了**跨设备模型借出/借用**。
|
|
4
|
+
|
|
5
|
+
**新增功能:模型共享**
|
|
6
|
+
|
|
7
|
+
- **借出(Lend)**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
|
|
8
|
+
- **借用(Borrow)**:借用其它设备借出的模型。借到的模型出现在本机模型选择器中,以对方**设备名称**作为提供商名,其下列出具体模型。
|
|
9
|
+
- **双向授权**:借出方按提供商/设备配置允许借出哪些模型;借用方按设备决定是否启用。只有两边都同意的模型才会出现在选择器里。
|
|
10
|
+
- **端到端加密**:模型请求走 ds-harness-remote 既有的 Noise 加密 P2P/中继通道,凭据不出本机。
|
|
11
|
+
- 配置入口:**设置 → 插件 → 本插件详情 → 「模型共享」区块**;也可用 CLI(`ds-harness-remote model-share show` 等),详见 [docs/model-sharing.md](https://github.com/musdrop/ds-harness-remote/blob/main/docs/model-sharing.md)。
|
|
12
|
+
|
|
13
|
+
**⚠️ 与原版不能同时安装**
|
|
14
|
+
|
|
15
|
+
本包与原版 `ds-harness-remote` 使用**相同的插件 ID**(`com.r2049.ds-harness-remote`),同一个 DSH profile 里**只能装两者之一**——同时安装时插件管理器把二者视为同一插件,启用开关互相影响、无法各自独立启停。
|
|
16
|
+
|
|
17
|
+
也正因为同 ID,本包可以直接**替换**原版:卸载原版、安装本包后,原有 Remote 配置(服务器地址、已授权设备、登录状态等)全部无缝继承,无需重新配对。模型共享的借出/借用配置存在独立的 `model-share.json`,不占用原版配置字段。想恢复原版时反向操作即可。
|
|
18
|
+
|
|
19
|
+
**安装本包**:先在插件管理里卸载原版 `ds-harness-remote`,再安装 `@musdrop/ds-harness-remote`,重启 DSH。
|
|
20
|
+
|
|
21
|
+
以下为原版 README。原有功能(远程工作区、会话接管、终端、文件上传下载、CodeX/ACP 等)在本包中全部可用。
|
|
23
22
|
|
|
24
23
|
---
|
|
25
24
|
|
|
@@ -33,7 +32,7 @@ Continue DeepSeek Harness sessions and experimental Codex, Cursor, and Antigravi
|
|
|
33
32
|
|
|
34
33
|
`ds-harness-remote` is the Remote Host and workspace plugin for DeepSeek Harness. Harness keeps running on your work computer with its existing workspaces, tools, and permission controls; Remote gives authorized devices another window into that environment.
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
Install the npm package through Desktop Plugin management or `dsh plugin`. Both manage the selected Harness profile and its bundle configuration.
|
|
37
36
|
|
|
38
37
|
## Remote Agent tools
|
|
39
38
|
|
package/dist/client.js
CHANGED
|
@@ -2191,6 +2191,7 @@ If a code was sent, recover the original submission without changing it.`,
|
|
|
2191
2191
|
hermesVirtualWorkspace: "Hermes virtual workspace",
|
|
2192
2192
|
kimiVirtualWorkspace: "Kimi virtual workspace",
|
|
2193
2193
|
codexVirtualSessions: "Sessions",
|
|
2194
|
+
// [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
|
|
2194
2195
|
modelSharing: "Model sharing",
|
|
2195
2196
|
modelSharingHint: "Lend your models to other devices, or borrow models from them.",
|
|
2196
2197
|
modelShareLending: "Lend models",
|
|
@@ -2226,6 +2227,7 @@ If a code was sent, recover the original submission without changing it.`,
|
|
|
2226
2227
|
modelShareSaveEdit: "Save rule",
|
|
2227
2228
|
modelShareSelectModelsHint: "No models selected yet",
|
|
2228
2229
|
modelShareClearDraft: "Clear form"
|
|
2230
|
+
// [model-sharing] END
|
|
2229
2231
|
}, zh = {
|
|
2230
2232
|
uploadTooLarge: "\u6587\u4EF6\u8D85\u8FC7\u5F53\u524D\u8FDE\u63A5\u7684\u5355\u6587\u4EF6\u4E0A\u4F20\u4E0A\u9650\uFF08{size}\uFF09\u3002",
|
|
2231
2233
|
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",
|
|
@@ -2639,6 +2641,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
2639
2641
|
hermesVirtualWorkspace: "Hermes \u5DE5\u4F5C\u533A",
|
|
2640
2642
|
kimiVirtualWorkspace: "Kimi \u5DE5\u4F5C\u533A",
|
|
2641
2643
|
codexVirtualSessions: "Sessions",
|
|
2644
|
+
// [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
|
|
2642
2645
|
modelSharing: "\u6A21\u578B\u5171\u4EAB",
|
|
2643
2646
|
modelSharingHint: "\u628A\u672C\u673A\u6A21\u578B\u501F\u7ED9\u5176\u4ED6\u8BBE\u5907\uFF0C\u6216\u501F\u7528\u5176\u4ED6\u8BBE\u5907\u7684\u6A21\u578B\u3002",
|
|
2644
2647
|
modelShareLending: "\u501F\u51FA\u6A21\u578B",
|
|
@@ -2674,6 +2677,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
2674
2677
|
modelShareSaveEdit: "\u4FDD\u5B58\u89C4\u5219",
|
|
2675
2678
|
modelShareSelectModelsHint: "\u5C1A\u672A\u9009\u62E9\u6A21\u578B",
|
|
2676
2679
|
modelShareClearDraft: "\u6E05\u7A7A\u8868\u5355"
|
|
2680
|
+
// [model-sharing] END
|
|
2677
2681
|
}, ru = {
|
|
2678
2682
|
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}).",
|
|
2679
2683
|
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.",
|
|
@@ -3087,6 +3091,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
3087
3091
|
hermesVirtualWorkspace: "\u0412\u0438\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0430\u044F \u0440\u0430\u0431\u043E\u0447\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C Hermes",
|
|
3088
3092
|
kimiVirtualWorkspace: "\u0412\u0438\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0430\u044F \u0440\u0430\u0431\u043E\u0447\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C Kimi",
|
|
3089
3093
|
codexVirtualSessions: "\u0421\u0435\u0441\u0441\u0438\u0438",
|
|
3094
|
+
// [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
|
|
3090
3095
|
modelSharing: "\u041E\u0431\u043C\u0435\u043D \u043C\u043E\u0434\u0435\u043B\u044F\u043C\u0438",
|
|
3091
3096
|
modelSharingHint: "\u041F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0439\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u0434\u0440\u0443\u0433\u0438\u043C \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430\u043C \u0438\u043B\u0438 \u0437\u0430\u0438\u043C\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432.",
|
|
3092
3097
|
modelShareLending: "\u041F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
|
|
@@ -3122,6 +3127,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
3122
3127
|
modelShareSaveEdit: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
|
|
3123
3128
|
modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u044B",
|
|
3124
3129
|
modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u043E\u0440\u043C\u0443"
|
|
3130
|
+
// [model-sharing] END
|
|
3125
3131
|
}, uk = {
|
|
3126
3132
|
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}).",
|
|
3127
3133
|
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.",
|
|
@@ -3535,6 +3541,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
3535
3541
|
hermesVirtualWorkspace: "\u0412\u0456\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0431\u043E\u0447\u0438\u0439 \u043F\u0440\u043E\u0441\u0442\u0456\u0440 Hermes",
|
|
3536
3542
|
kimiVirtualWorkspace: "\u0412\u0456\u0440\u0442\u0443\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0431\u043E\u0447\u0438\u0439 \u043F\u0440\u043E\u0441\u0442\u0456\u0440 Kimi",
|
|
3537
3543
|
codexVirtualSessions: "\u0421\u0435\u0441\u0456\u0457",
|
|
3544
|
+
// [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
|
|
3538
3545
|
modelSharing: "\u041C\u043E\u0434\u0435\u043B\u044C\u043D\u0438\u0439 \u043E\u0431\u043C\u0456\u043D",
|
|
3539
3546
|
modelSharingHint: "\u041D\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u0456 \u0456\u043D\u0448\u0438\u043C \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u044F\u043C \u0430\u0431\u043E \u043F\u043E\u0437\u0438\u0447\u0430\u0439\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u0456 \u0437 \u0456\u043D\u0448\u0438\u0445 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457\u0432.",
|
|
3540
3547
|
modelShareLending: "\u041D\u0430\u0434\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
|
|
@@ -3570,6 +3577,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
3570
3577
|
modelShareSaveEdit: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
|
|
3571
3578
|
modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0456 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",
|
|
3572
3579
|
modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u043E\u0440\u043C\u0443"
|
|
3580
|
+
// [model-sharing] END
|
|
3573
3581
|
};
|
|
3574
3582
|
|
|
3575
3583
|
// packages/plugin/src/client/header.ts
|
|
@@ -5860,12 +5868,14 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
5860
5868
|
sidebarEntrySetting,
|
|
5861
5869
|
resetIdentitySetting,
|
|
5862
5870
|
acpSetting,
|
|
5871
|
+
// [model-sharing] BEGIN — model-share block inside the options list.
|
|
5863
5872
|
// [model-sharing] 专用的模型借出/借用配置区块。
|
|
5864
5873
|
React.createElement(ModelSharingSection, {
|
|
5865
5874
|
control: props.control,
|
|
5866
5875
|
t,
|
|
5867
5876
|
available: writable
|
|
5868
5877
|
}),
|
|
5878
|
+
// [model-sharing] END
|
|
5869
5879
|
React.createElement(
|
|
5870
5880
|
"div",
|
|
5871
5881
|
{ className: "dshRemoteAuthorizationSetting" },
|
|
@@ -5957,12 +5967,14 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
5957
5967
|
sidebarEntrySetting,
|
|
5958
5968
|
resetIdentitySetting,
|
|
5959
5969
|
acpSetting,
|
|
5970
|
+
// [model-sharing] BEGIN — model-share block inside the options list.
|
|
5960
5971
|
// [model-sharing] 专用的模型借出/借用配置区块。
|
|
5961
5972
|
React.createElement(ModelSharingSection, {
|
|
5962
5973
|
control: props.control,
|
|
5963
5974
|
t,
|
|
5964
5975
|
available: writable
|
|
5965
5976
|
}),
|
|
5977
|
+
// [model-sharing] END
|
|
5966
5978
|
React.createElement(
|
|
5967
5979
|
"div",
|
|
5968
5980
|
{ className: "dshRemoteSettingsSignIn" },
|
|
@@ -6076,13 +6088,15 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
6076
6088
|
".dshRemoteAcpList{display:flex;flex-direction:column;margin-top:10px;padding-left:16px;border-top:1px solid var(--dsw-alias-border-l3)}.dshRemoteAcpRow{display:flex;flex-direction:column;gap:4px;padding:10px 0}.dshRemoteAcpRow+.dshRemoteAcpRow{border-top:1px solid var(--dsw-alias-border-l3)}.dshRemoteAcpRowMain{display:grid;grid-template-columns:minmax(0,1fr) auto 38px;align-items:center;column-gap:16px;min-width:0}.dshRemoteAcpRowInfo{display:flex;align-items:center;gap:12px;min-width:0}.dshRemoteAcpName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;line-height:1.45;color:var(--dsw-alias-label-primary)}",
|
|
6077
6089
|
'.dshRemoteAcpStatus{display:inline-flex;align-items:center;gap:6px;min-width:0;font-size:12px;font-weight:400;line-height:1.45;color:var(--dsw-alias-label-tertiary);white-space:nowrap}.dshRemoteAcpStatus::before{content:"";width:5px;height:5px;border-radius:50%;background:var(--dsw-alias-label-dimmed);flex:0 0 auto}.dshRemoteAcpStatus.isPassed{color:var(--dsw-alias-label-secondary)}.dshRemoteAcpStatus.isPassed::before{background:var(--dsw-alias-state-success-primary)}.dshRemoteAcpStatus.isFailed{color:var(--dsw-alias-state-danger-primary)}.dshRemoteAcpStatus.isFailed::before{background:var(--dsw-alias-state-danger-primary)}.dshRemoteAcpStatus.isChecking{color:var(--dsw-alias-label-secondary)}.dshRemoteAcpStatus.isChecking::before{background:var(--dsw-alias-brand-primary)}',
|
|
6078
6090
|
".dshRemoteAcpRowActions{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;justify-self:end}.dshRemoteAcpActionBtn,.dshRemoteAcpRemoveBtn,.dshRemoteAcpAddTrigger{appearance:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:5px;height:28px;padding:0 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:color .14s,background .14s}.dshRemoteAcpActionBtn:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.dshRemoteAcpActionBtn.isConfigure{color:var(--dsw-alias-brand-primary)}.dshRemoteAcpActionBtn.isConfigure:hover:not(:disabled){color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 10%,transparent)}.dshRemoteAcpActionBtn:disabled,.dshRemoteAcpRemoveBtn:disabled,.dshRemoteAcpAddTrigger:disabled{opacity:.45;cursor:default}.dshRemoteAcpRemoveBtn{color:var(--dsw-alias-label-tertiary)}.dshRemoteAcpRemoveBtn:hover:not(:disabled){color:var(--dsw-alias-state-danger-primary);background:color-mix(in srgb,var(--dsw-alias-state-danger-primary) 10%,transparent)}",
|
|
6079
|
-
// [model-sharing]
|
|
6080
|
-
//
|
|
6091
|
+
// [model-sharing] BEGIN — the settings section reuses the ACP row classes;
|
|
6092
|
+
// this selector only adds the select / number controls it introduces.
|
|
6081
6093
|
".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}",
|
|
6094
|
+
// [model-sharing] END
|
|
6082
6095
|
".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}}",
|
|
6083
|
-
// [model-sharing]
|
|
6084
|
-
// model-share settings section; everything else reuses dshRemoteAcp*.
|
|
6096
|
+
// [model-sharing] BEGIN — collapsible checkbox pickers and grant rows inside
|
|
6097
|
+
// the model-share settings section; everything else reuses dshRemoteAcp*.
|
|
6085
6098
|
'.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}}',
|
|
6099
|
+
// [model-sharing] END
|
|
6086
6100
|
".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}",
|
|
6087
6101
|
".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)}",
|
|
6088
6102
|
'.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}',
|
|
@@ -8853,9 +8867,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
8853
8867
|
})
|
|
8854
8868
|
}, RemoteWorkspaceAction)), ctx.slots.inject("plugins.row.config", () => ctx.slots.register({
|
|
8855
8869
|
name: "plugins.row.config",
|
|
8856
|
-
// [
|
|
8870
|
+
// [fork-identity] BEGIN — row slot key must carry the scoped fork name.
|
|
8871
|
+
// [fork-identity] The key must match the installed package name; the
|
|
8857
8872
|
// host resolves slot ownership by it.
|
|
8858
8873
|
key: `${clientModuleId}#ds-harness-remote`,
|
|
8874
|
+
// [fork-identity] END
|
|
8859
8875
|
locale: localeNamespace,
|
|
8860
8876
|
inject: () => ({
|
|
8861
8877
|
control,
|
|
@@ -8866,7 +8882,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
|
|
|
8866
8882
|
})
|
|
8867
8883
|
}, RemotePluginOptions)), ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
|
|
8868
8884
|
name: "plugins.bundle.config",
|
|
8885
|
+
// [fork-identity] BEGIN — bundle slot key follows the same fork name.
|
|
8869
8886
|
key: clientModuleId,
|
|
8887
|
+
// [fork-identity] END
|
|
8870
8888
|
locale: localeNamespace,
|
|
8871
8889
|
inject: () => ({
|
|
8872
8890
|
control,
|
package/dist/index.js
CHANGED
|
@@ -75192,8 +75192,10 @@ var configSchema = external_exports.object({
|
|
|
75192
75192
|
binary: external_exports.string().trim().min(1).max(4096).optional()
|
|
75193
75193
|
}).strict().optional(),
|
|
75194
75194
|
acp: external_exports.object({ enabled: external_exports.boolean().optional(), backends: external_exports.array(external_exports.object({ id: external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/i), enabled: external_exports.boolean().optional(), command: external_exports.string().trim().min(1).max(4096).optional(), args: external_exports.array(external_exports.string().max(4096)).max(32).optional(), cwd: external_exports.string().max(4096).optional() }).strict()).max(12).optional(), backend: external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/i).optional(), command: external_exports.string().trim().min(1).max(4096).optional(), args: external_exports.array(external_exports.string().max(4096)).max(32).optional(), cwd: external_exports.string().max(4096).optional() }).strict().optional(),
|
|
75195
|
+
// [model-sharing] BEGIN — .strict() would reject a config carrying this key.
|
|
75195
75196
|
// [model-sharing] Master switch only; grants live in the feature's own store.
|
|
75196
75197
|
modelShare: external_exports.object({ enabled: external_exports.boolean().optional() }).strict().optional()
|
|
75198
|
+
// [model-sharing] END
|
|
75197
75199
|
}).strict();
|
|
75198
75200
|
function resolveConfig(input4 = {}, env = process.env) {
|
|
75199
75201
|
const parsed = configSchema.parse(input4);
|
|
@@ -75260,9 +75262,11 @@ function resolveConfig(input4 = {}, env = process.env) {
|
|
|
75260
75262
|
};
|
|
75261
75263
|
})
|
|
75262
75264
|
},
|
|
75265
|
+
// [model-sharing] BEGIN — default value; index.ts dereferences .enabled.
|
|
75263
75266
|
// [model-sharing] On by default: the surface stays inert until the store
|
|
75264
75267
|
// enables a grant on the lending side or a source on the borrowing side.
|
|
75265
75268
|
modelShare: { enabled: parsed.modelShare?.enabled !== false }
|
|
75269
|
+
// [model-sharing] END
|
|
75266
75270
|
};
|
|
75267
75271
|
}
|
|
75268
75272
|
var LOCAL_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
@@ -75383,7 +75387,7 @@ function parseIpv6(value) {
|
|
|
75383
75387
|
}
|
|
75384
75388
|
|
|
75385
75389
|
// packages/plugin/src/version.ts
|
|
75386
|
-
var PLUGIN_VERSION = "0.6.
|
|
75390
|
+
var PLUGIN_VERSION = "0.6.20";
|
|
75387
75391
|
|
|
75388
75392
|
// packages/plugin/src/server-api.ts
|
|
75389
75393
|
var TERMINAL_CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f]/u;
|
|
@@ -93834,6 +93838,7 @@ var ClientModeRuntime = class {
|
|
|
93834
93838
|
if (this.closed) throw new ClientModeError("CANCELLED", "The Remote runtime is closed.");
|
|
93835
93839
|
return this.sessionTools.run(operation, args, signal);
|
|
93836
93840
|
}
|
|
93841
|
+
// [model-sharing] BEGIN — transport factory + listing call for borrowed models.
|
|
93837
93842
|
/**
|
|
93838
93843
|
* [model-sharing] A transport bound to one lending Host that **holds its
|
|
93839
93844
|
* connection across the whole borrowed stream**. `withToolRemote` would
|
|
@@ -93847,20 +93852,39 @@ var ClientModeRuntime = class {
|
|
|
93847
93852
|
let held;
|
|
93848
93853
|
let holding;
|
|
93849
93854
|
const acquire = async () => {
|
|
93855
|
+
const closed = () => this.closed || this.remoteLifetime.signal.aborted;
|
|
93850
93856
|
if (this.connected?.target.deviceId === hostId) {
|
|
93851
93857
|
return { remote: this.connected, signal: this.remoteLifetime.signal };
|
|
93852
93858
|
}
|
|
93853
|
-
if (held !== void 0)
|
|
93854
|
-
|
|
93859
|
+
if (held !== void 0) {
|
|
93860
|
+
if (!held.remote.client.getStats().connected) held = void 0;
|
|
93861
|
+
else return held;
|
|
93862
|
+
}
|
|
93863
|
+
if (holding !== void 0) {
|
|
93864
|
+
const settled = await holding.catch(() => void 0);
|
|
93865
|
+
if (settled !== void 0 && settled.remote.client.getStats().connected) return settled;
|
|
93866
|
+
holding = void 0;
|
|
93867
|
+
held = void 0;
|
|
93868
|
+
}
|
|
93869
|
+
holding = (async () => {
|
|
93855
93870
|
if (this.identity === void 0) await this.ensureIdentity();
|
|
93856
93871
|
const signal = this.remoteLifetime.signal;
|
|
93857
93872
|
const remote = await this.connection.connect(hostId, signal, { background: true });
|
|
93858
|
-
|
|
93873
|
+
const entry = { remote, signal };
|
|
93874
|
+
if (!remote.client.getStats().connected) {
|
|
93875
|
+
holding = void 0;
|
|
93876
|
+
throw new ClientModeError("TRANSPORT_CLOSED", "The borrowed-stream connection closed during setup.", true);
|
|
93877
|
+
}
|
|
93878
|
+
held = entry;
|
|
93859
93879
|
remote.client.onClose(() => {
|
|
93860
93880
|
if (held?.remote === remote) held = void 0;
|
|
93881
|
+
holding = void 0;
|
|
93861
93882
|
});
|
|
93862
|
-
return
|
|
93863
|
-
})()
|
|
93883
|
+
return entry;
|
|
93884
|
+
})().catch((error62) => {
|
|
93885
|
+
holding = void 0;
|
|
93886
|
+
throw closed() ? new ClientModeError("CANCELLED", "The Remote runtime is closed.") : error62;
|
|
93887
|
+
});
|
|
93864
93888
|
return holding;
|
|
93865
93889
|
};
|
|
93866
93890
|
const rpc = async (method, params, signal) => {
|
|
@@ -114010,7 +114034,7 @@ var ModelShareStoreFile = class {
|
|
|
114010
114034
|
}
|
|
114011
114035
|
cache;
|
|
114012
114036
|
writing = Promise.resolve();
|
|
114013
|
-
/** Active directory watcher, if `watch()` was called. */
|
|
114037
|
+
/** Active directory watcher and every callback it serves, if `watch()` was called. */
|
|
114014
114038
|
watcher;
|
|
114015
114039
|
get path() {
|
|
114016
114040
|
return join17(this.directory, this.fileName);
|
|
@@ -114050,45 +114074,67 @@ var ModelShareStoreFile = class {
|
|
|
114050
114074
|
*
|
|
114051
114075
|
* The watcher is best-effort: a missing directory simply yields no events,
|
|
114052
114076
|
* and a failed watch never throws into the caller.
|
|
114077
|
+
*
|
|
114078
|
+
* One directory handle serves every subscriber. A second `watch()` joins the
|
|
114079
|
+
* running watcher instead of replacing its callback, and the handle is closed
|
|
114080
|
+
* (freeing the slot) once the last subscriber unsubscribes — so a later
|
|
114081
|
+
* `watch()` installs a live watcher rather than handing back a stop function
|
|
114082
|
+
* whose handle is already closed.
|
|
114053
114083
|
*/
|
|
114054
114084
|
watch(onChange) {
|
|
114055
|
-
|
|
114085
|
+
const running = this.watcher;
|
|
114086
|
+
if (running !== void 0) {
|
|
114087
|
+
running.listeners.add(onChange);
|
|
114088
|
+
return this.unsubscribe(running, onChange);
|
|
114089
|
+
}
|
|
114090
|
+
const listeners = /* @__PURE__ */ new Set([onChange]);
|
|
114056
114091
|
let closed = false;
|
|
114057
114092
|
let timer2;
|
|
114093
|
+
let handle;
|
|
114058
114094
|
const emit2 = () => {
|
|
114059
114095
|
if (closed) return;
|
|
114060
114096
|
this.cache = void 0;
|
|
114061
114097
|
void this.read().then((store) => {
|
|
114062
|
-
if (
|
|
114098
|
+
if (closed) return;
|
|
114099
|
+
for (const listener of [...listeners]) {
|
|
114100
|
+
if (closed) return;
|
|
114101
|
+
listener(store);
|
|
114102
|
+
}
|
|
114063
114103
|
}).catch(() => void 0);
|
|
114064
114104
|
};
|
|
114105
|
+
const stop = () => {
|
|
114106
|
+
if (closed) return;
|
|
114107
|
+
closed = true;
|
|
114108
|
+
if (timer2 !== void 0) clearTimeout(timer2);
|
|
114109
|
+
timer2 = void 0;
|
|
114110
|
+
if (this.watcher?.stop === stop) this.watcher = void 0;
|
|
114111
|
+
try {
|
|
114112
|
+
handle?.close();
|
|
114113
|
+
} catch {
|
|
114114
|
+
}
|
|
114115
|
+
};
|
|
114065
114116
|
try {
|
|
114066
114117
|
const directory = this.directory;
|
|
114067
114118
|
const fileName = this.fileName;
|
|
114068
|
-
|
|
114119
|
+
handle = watch2(directory, { persistent: false }, (_event, changed) => {
|
|
114069
114120
|
if (changed != null && String(changed) !== fileName) return;
|
|
114070
114121
|
if (timer2 !== void 0) clearTimeout(timer2);
|
|
114071
114122
|
timer2 = setTimeout(emit2, 120);
|
|
114072
114123
|
timer2.unref?.();
|
|
114073
114124
|
});
|
|
114074
114125
|
handle.on("error", () => void 0);
|
|
114075
|
-
const stop = () => {
|
|
114076
|
-
closed = true;
|
|
114077
|
-
if (timer2 !== void 0) clearTimeout(timer2);
|
|
114078
|
-
try {
|
|
114079
|
-
handle.close();
|
|
114080
|
-
} catch {
|
|
114081
|
-
}
|
|
114082
|
-
};
|
|
114083
|
-
this.watcher = stop;
|
|
114084
|
-
return stop;
|
|
114085
114126
|
} catch {
|
|
114086
|
-
|
|
114087
|
-
closed = true;
|
|
114088
|
-
};
|
|
114089
|
-
this.watcher = stop;
|
|
114090
|
-
return stop;
|
|
114127
|
+
handle = void 0;
|
|
114091
114128
|
}
|
|
114129
|
+
const subscription = { listeners, stop };
|
|
114130
|
+
this.watcher = subscription;
|
|
114131
|
+
return this.unsubscribe(subscription, onChange);
|
|
114132
|
+
}
|
|
114133
|
+
unsubscribe(subscription, onChange) {
|
|
114134
|
+
return () => {
|
|
114135
|
+
subscription.listeners.delete(onChange);
|
|
114136
|
+
if (subscription.listeners.size === 0) subscription.stop();
|
|
114137
|
+
};
|
|
114092
114138
|
}
|
|
114093
114139
|
};
|
|
114094
114140
|
|
|
@@ -117217,8 +117263,7 @@ var MODEL_SHARE_METHODS = [
|
|
|
117217
117263
|
"model.share.list",
|
|
117218
117264
|
"model.share.open",
|
|
117219
117265
|
"model.share.chunk",
|
|
117220
|
-
"model.share.close"
|
|
117221
|
-
"model.share.config"
|
|
117266
|
+
"model.share.close"
|
|
117222
117267
|
];
|
|
117223
117268
|
var sharedModelSchema = external_exports.object({
|
|
117224
117269
|
/** Stable route key: `${provider}::${model}`. Also the borrower-facing model id. */
|
|
@@ -117230,12 +117275,9 @@ var sharedModelSchema = external_exports.object({
|
|
|
117230
117275
|
contextWindow: external_exports.number().int().positive().optional(),
|
|
117231
117276
|
maxTokens: external_exports.number().int().positive().optional(),
|
|
117232
117277
|
reasoningEfforts: external_exports.array(external_exports.string().min(1).max(64)).optional(),
|
|
117233
|
-
inputModalities: external_exports.array(external_exports.enum(["text", "image"])).optional()
|
|
117234
|
-
/** Optional upstream promo/availability badge text, passed through verbatim. */
|
|
117235
|
-
badge: external_exports.string().max(128).optional()
|
|
117278
|
+
inputModalities: external_exports.array(external_exports.enum(["text", "image"])).optional()
|
|
117236
117279
|
}).strict();
|
|
117237
117280
|
var listRequestSchema = external_exports.object({}).strict();
|
|
117238
|
-
var configRequestSchema = external_exports.object({}).strict();
|
|
117239
117281
|
var openRequestSchema = external_exports.object({
|
|
117240
117282
|
/** Stable route key from `model.share.list`. */
|
|
117241
117283
|
modelId: external_exports.string().min(1).max(256),
|
|
@@ -117323,8 +117365,10 @@ var apiMethods = /* @__PURE__ */ new Set([
|
|
|
117323
117365
|
"remote.transport.upgrade.activate",
|
|
117324
117366
|
"remote.transport.upgrade.drain",
|
|
117325
117367
|
"remote.transport.upgrade.abort",
|
|
117368
|
+
// [model-sharing] BEGIN — without these the router answers METHOD_NOT_FOUND.
|
|
117326
117369
|
// [model-sharing] Borrowed-model RPCs on the existing encrypted channel.
|
|
117327
117370
|
...MODEL_SHARE_METHODS
|
|
117371
|
+
// [model-sharing] END
|
|
117328
117372
|
]);
|
|
117329
117373
|
var HOST_CAPABILITIES = [
|
|
117330
117374
|
"harness.remote.v1",
|
|
@@ -117365,6 +117409,7 @@ var RpcRouter = class {
|
|
|
117365
117409
|
this.attention?.close();
|
|
117366
117410
|
this.loopback?.closeAll();
|
|
117367
117411
|
this.sessionTransfer?.close();
|
|
117412
|
+
this.modelShare?.closeAll();
|
|
117368
117413
|
await Promise.all([
|
|
117369
117414
|
this.harnessRemote?.closeAll(),
|
|
117370
117415
|
this.codex?.closeAll(),
|
|
@@ -117451,8 +117496,10 @@ var RpcRouter = class {
|
|
|
117451
117496
|
...this.dshWeb?.available() ? [DSH_WEB_CAPABILITY] : [],
|
|
117452
117497
|
...this.transportUpgrade === void 0 ? [] : [TRANSPORT_UPGRADE_CAPABILITY],
|
|
117453
117498
|
...this.attention === void 0 ? [] : [ATTENTION_INBOX_CAPABILITY],
|
|
117499
|
+
// [model-sharing] BEGIN — clients gate the whole feature on this flag.
|
|
117454
117500
|
// [model-sharing] Only advertise lending when this Host can serve it.
|
|
117455
117501
|
...this.modelShare === void 0 ? [] : [MODEL_SHARE_CAPABILITY]
|
|
117502
|
+
// [model-sharing] END
|
|
117456
117503
|
])];
|
|
117457
117504
|
let workspaceTypes;
|
|
117458
117505
|
if (this.workspaceTypes !== void 0) {
|
|
@@ -117604,7 +117651,6 @@ var RpcRouter = class {
|
|
|
117604
117651
|
// [model-sharing] BEGIN — lending dispatch. Every branch re-checks the
|
|
117605
117652
|
// lending policy host-side; a borrower can never widen its own access.
|
|
117606
117653
|
case "model.share.list":
|
|
117607
|
-
case "model.share.config":
|
|
117608
117654
|
case "model.share.open":
|
|
117609
117655
|
case "model.share.chunk":
|
|
117610
117656
|
case "model.share.close":
|
|
@@ -122130,9 +122176,12 @@ var HostPluginRuntime = class {
|
|
|
122130
122176
|
context.connectionId,
|
|
122131
122177
|
(event2) => send(createEvent("attention.follow.event", event2))
|
|
122132
122178
|
),
|
|
122179
|
+
// [model-sharing] BEGIN — last RpcRouter argument; losing it silently
|
|
122180
|
+
// passes the lending host where upstream expects nothing.
|
|
122133
122181
|
// [model-sharing] Lending is per-connection because the grant check
|
|
122134
122182
|
// needs the authenticated peer device id.
|
|
122135
122183
|
this.modelShareFactory?.(context.peerDeviceId)
|
|
122184
|
+
// [model-sharing] END
|
|
122136
122185
|
);
|
|
122137
122186
|
}, this.logger);
|
|
122138
122187
|
if (config2.serverUrl !== void 0) {
|
|
@@ -122741,9 +122790,9 @@ var ModelShareHost = class {
|
|
|
122741
122790
|
*/
|
|
122742
122791
|
async listShared(deviceId) {
|
|
122743
122792
|
const { host } = await this.store.read();
|
|
122744
|
-
if (!host.enabled) return { enabled: false, models: []
|
|
122793
|
+
if (!host.enabled) return { enabled: false, models: [] };
|
|
122745
122794
|
if (host.allowedDevices.length > 0 && !host.allowedDevices.includes(deviceId)) {
|
|
122746
|
-
return { enabled: false, models: []
|
|
122795
|
+
return { enabled: false, models: [] };
|
|
122747
122796
|
}
|
|
122748
122797
|
const allowed = allowedRoutes(host, deviceId);
|
|
122749
122798
|
const wildcardProviders = /* @__PURE__ */ new Set();
|
|
@@ -122802,7 +122851,7 @@ var ModelShareHost = class {
|
|
|
122802
122851
|
const entry = (catalogs.get(provider) ?? []).find((candidate) => candidate.id === model);
|
|
122803
122852
|
if (entry !== void 0) await emit2(provider, entry);
|
|
122804
122853
|
}
|
|
122805
|
-
return { enabled: true, models
|
|
122854
|
+
return { enabled: true, models };
|
|
122806
122855
|
}
|
|
122807
122856
|
async safeResolve(provider, entry) {
|
|
122808
122857
|
try {
|
|
@@ -122811,10 +122860,6 @@ var ModelShareHost = class {
|
|
|
122811
122860
|
return entry;
|
|
122812
122861
|
}
|
|
122813
122862
|
}
|
|
122814
|
-
/** `model.share.config` — policy summary for this peer. */
|
|
122815
|
-
async describePolicy(deviceId) {
|
|
122816
|
-
return this.listShared(deviceId);
|
|
122817
|
-
}
|
|
122818
122863
|
/** `model.share.open` — begin one bridged stream. */
|
|
122819
122864
|
async open(deviceId, params) {
|
|
122820
122865
|
const request2 = openRequestSchema.parse(params);
|
|
@@ -122877,7 +122922,7 @@ var ModelShareHost = class {
|
|
|
122877
122922
|
}
|
|
122878
122923
|
if (active2.finished === void 0) active2.finished = { reason: "stop" };
|
|
122879
122924
|
} catch (error62) {
|
|
122880
|
-
const code =
|
|
122925
|
+
const code = "INTERNAL_ERROR";
|
|
122881
122926
|
active2.finished = {
|
|
122882
122927
|
reason: "error",
|
|
122883
122928
|
failure: {
|
|
@@ -122969,9 +123014,6 @@ var ModelShareHost = class {
|
|
|
122969
123014
|
case "model.share.list":
|
|
122970
123015
|
listRequestSchema.parse(params);
|
|
122971
123016
|
return this.listShared(deviceId);
|
|
122972
|
-
case "model.share.config":
|
|
122973
|
-
configRequestSchema.parse(params);
|
|
122974
|
-
return this.describePolicy(deviceId);
|
|
122975
123017
|
case "model.share.open":
|
|
122976
123018
|
return this.open(deviceId, params);
|
|
122977
123019
|
case "model.share.chunk":
|
|
@@ -126915,20 +126957,6 @@ var RemoteModelAdapter = class extends LlmAdapter {
|
|
|
126915
126957
|
providerInfo(provider) {
|
|
126916
126958
|
return { id: provider, name: this.transport.hostName };
|
|
126917
126959
|
}
|
|
126918
|
-
providerRetryPolicy(_provider) {
|
|
126919
|
-
return void 0;
|
|
126920
|
-
}
|
|
126921
|
-
imageRequestPricing(_provider, _model) {
|
|
126922
|
-
return void 0;
|
|
126923
|
-
}
|
|
126924
|
-
imageRequestTarget(_provider, _model, image) {
|
|
126925
|
-
return {
|
|
126926
|
-
width: image.width,
|
|
126927
|
-
height: image.height,
|
|
126928
|
-
maxImageBytes: image.bytes,
|
|
126929
|
-
imageTargetBytes: image.bytes
|
|
126930
|
-
};
|
|
126931
|
-
}
|
|
126932
126960
|
async listModels(provider) {
|
|
126933
126961
|
return this.deduplicated().map((entry) => this.toModelInfo(provider, entry));
|
|
126934
126962
|
}
|
|
@@ -127110,10 +127138,11 @@ var BorrowerRuntime = class {
|
|
|
127110
127138
|
const bound = {
|
|
127111
127139
|
hostId,
|
|
127112
127140
|
hostName,
|
|
127113
|
-
|
|
127141
|
+
...transport.onStale === void 0 ? {} : { onStale: transport.onStale },
|
|
127114
127142
|
open: (request2) => transport.open(request2),
|
|
127115
127143
|
drain: (streamId, waitMs) => transport.drain(streamId, waitMs),
|
|
127116
|
-
close: (streamId) => transport.close(streamId)
|
|
127144
|
+
close: (streamId) => transport.close(streamId),
|
|
127145
|
+
...transport.release === void 0 ? {} : { release: transport.release }
|
|
127117
127146
|
};
|
|
127118
127147
|
await this.reconcile(hostId, hostName, bound, lent);
|
|
127119
127148
|
}
|
|
@@ -127145,9 +127174,11 @@ var BorrowerRuntime = class {
|
|
|
127145
127174
|
existing.holder.models = [...selected];
|
|
127146
127175
|
existing.models = existing.holder.models;
|
|
127147
127176
|
if (existing.transport !== transport) {
|
|
127148
|
-
|
|
127149
|
-
|
|
127150
|
-
|
|
127177
|
+
if (existing.transport?.release !== transport.release) {
|
|
127178
|
+
try {
|
|
127179
|
+
existing.transport?.release?.();
|
|
127180
|
+
} catch {
|
|
127181
|
+
}
|
|
127151
127182
|
}
|
|
127152
127183
|
existing.transport = transport;
|
|
127153
127184
|
}
|
|
@@ -127162,6 +127193,9 @@ var BorrowerRuntime = class {
|
|
|
127162
127193
|
// on the registration cannot change model metadata, so reconcile writes
|
|
127163
127194
|
// the new set here and the adapter reads it on every call.
|
|
127164
127195
|
models: () => holder.models,
|
|
127196
|
+
// The stale hook has to reach the adapter, not stop at the bound object:
|
|
127197
|
+
// the adapter is what notices a missing model or a dropped connection.
|
|
127198
|
+
...transport.onStale === void 0 ? {} : { onStale: transport.onStale },
|
|
127165
127199
|
open: (request2) => transport.open(request2),
|
|
127166
127200
|
drain: (streamId, waitMs) => transport.drain(streamId, waitMs),
|
|
127167
127201
|
close: (streamId) => transport.close(streamId)
|
|
@@ -128688,8 +128722,11 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
|
|
|
128688
128722
|
const attachments = safeGetService2(ctx, "attachments") ?? safeGetService2(rootContext(ctx), "attachments");
|
|
128689
128723
|
return attachments?.fileHostPath?.(ref);
|
|
128690
128724
|
},
|
|
128725
|
+
// [model-sharing] BEGIN — appended HostPluginRuntime argument; upstream
|
|
128726
|
+
// ends the list at the attachment path resolver above.
|
|
128691
128727
|
// [model-sharing] Lending factory for this Host connection.
|
|
128692
128728
|
lendingFactory
|
|
128729
|
+
// [model-sharing] END
|
|
128693
128730
|
);
|
|
128694
128731
|
let nextClientRuntime;
|
|
128695
128732
|
if (nextConfig.serverUrl !== void 0 && connection !== void 0) {
|
|
@@ -128850,6 +128887,8 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
|
|
|
128850
128887
|
pluginUpgrade,
|
|
128851
128888
|
true,
|
|
128852
128889
|
logStore,
|
|
128890
|
+
// [model-sharing] BEGIN — appended PluginControlRuntime argument; the
|
|
128891
|
+
// class declares no parameter for it upstream.
|
|
128853
128892
|
// [model-sharing] Lazy binding so server switches recreate the store
|
|
128854
128893
|
// and the borrower providers can be resynced after a policy edit.
|
|
128855
128894
|
// `describe` reports per-source borrow diagnostics: without a client
|
|
@@ -128865,6 +128904,7 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
|
|
|
128865
128904
|
sources: modelShareBorrowers.flatMap((borrower) => borrower.describeBorrower())
|
|
128866
128905
|
})
|
|
128867
128906
|
}
|
|
128907
|
+
// [model-sharing] END
|
|
128868
128908
|
);
|
|
128869
128909
|
if (initialStorageError !== void 0) {
|
|
128870
128910
|
controlRuntime?.setStartupFailure(initialStorageError, { storageAvailable: false });
|
package/dsh-plugin.json
CHANGED
package/locale/README.en.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> The original feature tour follows.
|
|
1
|
+
## This is a fork, not the original
|
|
2
|
+
|
|
3
|
+
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:
|
|
4
|
+
|
|
5
|
+
- **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.
|
|
6
|
+
- **Borrow**: use models another device lends; they appear in the local model picker under that device's **name** as the provider.
|
|
7
|
+
- **Two-sided grants**: the lender picks providers/devices and models; the borrower opts in per device. Only models allowed on both sides show up.
|
|
8
|
+
- Configuration lives in this plugin's detail page, in the new **"Model sharing" section**.
|
|
9
|
+
|
|
10
|
+
**⚠️ 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`.
|
|
11
|
+
|
|
12
|
+
The original feature tour follows.
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
package/locale/README.ja.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> 以下は原版の機能紹介です。
|
|
1
|
+
## これはフォーク版です(原版ではありません)
|
|
2
|
+
|
|
3
|
+
本プラグイン(`@musdrop/ds-harness-remote`)は [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) のフォークで、既存の全機能に加えて**デバイス間モデル貸借**を追加しています:
|
|
4
|
+
|
|
5
|
+
- **貸出(Lend)**:このマシンが設定済みのモデルを他デバイスに貸し出します。リクエストはこのマシンが自身の資格情報で代行し、相手に秘密情報は渡りませんが、消費されるのはこのマシンのクォータです。
|
|
6
|
+
- **借用(Borrow)**:他デバイスが貸し出したモデルを利用でき、選択器には相手の**デバイス名**をプロバイダーとして表示されます。
|
|
7
|
+
- **双方向の許可**:貸し手はプロバイダー/デバイス/モデルを指定し、借り手はデバイスごとに有効化します。双方が許可したモデルのみ表示されます。
|
|
8
|
+
- 設定は本プラグインの詳細ページにある**「モデル共有」セクション**で行います。
|
|
9
|
+
|
|
10
|
+
**⚠️ 原版との併用不可**:原版 `ds-harness-remote` と同じプラグイン ID を持つため、同一 profile にはどちらか一方のみ。同 ID であるため、このフォークは原版をシームレスに**置き換え**でき、既存の Remote 設定とサインイン状態はそのまま引き継がれます。
|
|
11
|
+
|
|
12
|
+
以下は原版の機能紹介です。
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
package/locale/README.ru.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> Ниже — описание оригинальных функций.
|
|
1
|
+
## Это форк, а не оригинал
|
|
2
|
+
|
|
3
|
+
Этот плагин (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), добавляющий **предоставление и заимствование моделей между устройствами** поверх всех функций ниже:
|
|
4
|
+
|
|
5
|
+
- **Предоставление**: этот компьютер отдаёт свои настроенные модели другим устройствам. Запросы выполняются локально с собственными учётными данными — заёмщик не видит секретов, но расходуется квота этого компьютера.
|
|
6
|
+
- **Заимствование**: модели, предоставленные другими устройствами, появляются в локальном выборе моделей под **именем устройства** как провайдером.
|
|
7
|
+
- **Двусторонние правила**: владелец задаёт провайдеров/устройства и модели, заёмщик включают по устройствам. Показываются только модели, разрешённые с обеих сторон.
|
|
8
|
+
- Настройки — в карточке этого плагина, в новом разделе **«Обмен моделями»**.
|
|
9
|
+
|
|
10
|
+
**⚠️ Нельзя устанавливать вместе с оригиналом**: у плагина тот же идентификатор, что у `ds-harness-remote`, поэтому в профиле может стоять только один из них. Общий идентификатор также означает, что форк **заменяет** оригинал без потерь — существующие настройки Remote и вход в аккаунт сохраняются.
|
|
11
|
+
|
|
12
|
+
Ниже — описание оригинальных функций.
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
package/locale/README.uk.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> Нижче — опис оригінальних функцій.
|
|
1
|
+
## Це форк, а не оригінал
|
|
2
|
+
|
|
3
|
+
Цей плагін (`@musdrop/ds-harness-remote`) — форк [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote), що додає **надання та позичання моделей між пристроями** поверх усіх функцій нижче:
|
|
4
|
+
|
|
5
|
+
- **Надання**: цей комп'ютер віддає свої налаштовані моделі іншим пристроям. Запити виконуються локально з власними обліковими даними — позичальник не бачить секретів, але витрачається квота цього комп'ютера.
|
|
6
|
+
- **Позичання**: моделі, надані іншими пристроями, з'являються в локальному виборі моделей під **іменем пристрою** як провайдером.
|
|
7
|
+
- **Двосторонні правила**: власник задає провайдерів/пристрої та моделі, позичальник вмикає за пристроями. Показуються лише моделі, дозволені з обох боків.
|
|
8
|
+
- Налаштування — в картці цього плагіна, в новому розділі **«Модельний обмін»**.
|
|
9
|
+
|
|
10
|
+
**⚠️ Не можна встановлювати разом з оригіналом**: у плагіна той самий ідентифікатор, що й у `ds-harness-remote`, тож у профілі може бути лише один з них. Спільний ідентифікатор також означає, що форк **замінює** оригінал без втрат — наявні налаштування Remote та вхід в акаунт зберігаються.
|
|
11
|
+
|
|
12
|
+
Нижче — опис оригінальних функцій.
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
package/locale/README.zh.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
> 以下为原版功能介绍。
|
|
1
|
+
## 这是一个 fork,不是原版
|
|
2
|
+
|
|
3
|
+
本插件(`@musdrop/ds-harness-remote`)是 [`liguobao/ds-harness-remote`](https://github.com/liguobao/ds-harness-remote) 的 fork,在原有全部功能之上新增了**跨设备模型借出/借用**:
|
|
4
|
+
|
|
5
|
+
- **借出**:把本机已配置的模型借给其它设备。请求由本机代发、使用本机自己的凭据——对方拿不到任何密钥,但每次调用消耗的是本机账号的额度。
|
|
6
|
+
- **借用**:借用其它设备借出的模型,借到的模型以对方**设备名**作为提供商出现在本机模型选择器中。
|
|
7
|
+
- **双向授权**:借出方按提供商/设备配置允许借出的模型,借用方按设备决定是否启用;两边都同意的模型才会出现。
|
|
8
|
+
- 配置入口:本插件详情页下方新增的**「模型共享」区块**。
|
|
9
|
+
|
|
10
|
+
**⚠️ 与原版不能同时安装**:本插件与原版 `ds-harness-remote` 使用相同插件 ID,同一 profile 只能装其一。同 ID 也意味着本插件可直接**替换**原版,原有 Remote 配置与登录状态无缝继承。模型共享的授权配置存在独立的 `model-share.json`,不影响原版配置字段。
|
|
11
|
+
|
|
12
|
+
以下为原版功能介绍。
|
|
14
13
|
|
|
15
14
|
---
|
|
16
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@musdrop/ds-harness-remote",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.20",
|
|
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",
|