@musdrop/ds-harness-remote 0.6.24 → 0.6.26

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/dist/client.js CHANGED
@@ -2191,7 +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
+ // model-sharing strings, appended after upstream's last key.
2195
2195
  modelSharing: "Model sharing",
2196
2196
  modelSharingHint: "Lend your models to other devices, or borrow models from them.",
2197
2197
  modelShareLending: "Lend models",
@@ -2199,7 +2199,9 @@ If a code was sent, recover the original submission without changing it.`,
2199
2199
  modelShareBorrowing: "Borrow models",
2200
2200
  modelShareBorrowingHint: "Borrowed models appear in your model picker.",
2201
2201
  modelShareEnableLending: "Allow lending models",
2202
- modelShareNoGrants: "No models are lent yet.",
2202
+ modelShareNoGrants: "No local models are available to share.",
2203
+ modelShareNoLocalModels: "No local models are available to share.",
2204
+ modelShareRefresh: "Refresh",
2203
2205
  modelShareNoSources: "No borrowing sources are configured yet.",
2204
2206
  modelShareAddGrant: "Add rule",
2205
2207
  modelShareRemove: "Remove",
@@ -2213,7 +2215,7 @@ If a code was sent, recover the original submission without changing it.`,
2213
2215
  modelShareSaved: "Model sharing settings saved.",
2214
2216
  modelShareSelectProvider: "Select a provider",
2215
2217
  modelShareSelectModels: "Select models",
2216
- modelShareBorrowFrom: "Borrow from",
2218
+ modelShareBorrowFrom: "Borrow from {name}",
2217
2219
  modelShareOffline: "offline",
2218
2220
  modelShareOnline: "online",
2219
2221
  modelShareNotLoaded: "Model sharing settings are unavailable.",
@@ -2222,12 +2224,11 @@ If a code was sent, recover the original submission without changing it.`,
2222
2224
  modelShareBorrowStatusDisconnected: "Not connected to Remote: borrowing cannot sync.",
2223
2225
  modelShareBorrowStatusFailed: "Connection failed: {reason}",
2224
2226
  modelShareBorrowStatusPeerEmpty: "This device lends nothing usable right now.",
2225
- modelShareRuleAnyDeviceHint: "A rule without any selected device applies to every authorized peer.",
2227
+ modelShareRuleAnyDeviceHint: "Shared models are available to peers this device allows to control it remotely. Turn that off to stop sharing entirely.",
2226
2228
  modelShareEdit: "Edit",
2227
2229
  modelShareSaveEdit: "Save rule",
2228
2230
  modelShareSelectModelsHint: "No models selected yet",
2229
2231
  modelShareClearDraft: "Clear form",
2230
- // [model-sharing] END
2231
2232
  modelShareBorrowStatusHostDisabled: "The other device is not lending to this machine right now (its model sharing is off, or no rule covers this device). Ask them to check their lending rules."
2232
2233
  }, zh = {
2233
2234
  downloadRemoteOriginal: "\u4E0B\u8F7D\u8FDC\u7A0B\u539F\u6587\u4EF6",
@@ -2641,7 +2642,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2641
2642
  hermesVirtualWorkspace: "Hermes \u5DE5\u4F5C\u533A",
2642
2643
  kimiVirtualWorkspace: "Kimi \u5DE5\u4F5C\u533A",
2643
2644
  codexVirtualSessions: "Sessions",
2644
- // [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
2645
+ // model-sharing strings, appended after upstream's last key.
2645
2646
  modelSharing: "\u6A21\u578B\u5171\u4EAB",
2646
2647
  modelSharingHint: "\u628A\u672C\u673A\u6A21\u578B\u501F\u7ED9\u5176\u4ED6\u8BBE\u5907\uFF0C\u6216\u501F\u7528\u5176\u4ED6\u8BBE\u5907\u7684\u6A21\u578B\u3002",
2647
2648
  modelShareLending: "\u501F\u51FA\u6A21\u578B",
@@ -2649,7 +2650,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2649
2650
  modelShareBorrowing: "\u501F\u7528\u6A21\u578B",
2650
2651
  modelShareBorrowingHint: "\u501F\u5230\u7684\u6A21\u578B\u4F1A\u51FA\u73B0\u5728\u672C\u673A\u7684\u6A21\u578B\u9009\u62E9\u5668\u4E2D\u3002",
2651
2652
  modelShareEnableLending: "\u5141\u8BB8\u501F\u51FA\u6A21\u578B",
2652
- modelShareNoGrants: "\u8FD8\u6CA1\u6709\u501F\u51FA\u4EFB\u4F55\u6A21\u578B\u3002",
2653
+ modelShareNoGrants: "\u6CA1\u6709\u53EF\u5171\u4EAB\u7684\u672C\u5730\u6A21\u578B\u3002",
2654
+ modelShareNoLocalModels: "\u6CA1\u6709\u53EF\u5171\u4EAB\u7684\u672C\u5730\u6A21\u578B\u3002",
2655
+ modelShareRefresh: "\u5237\u65B0",
2653
2656
  modelShareNoSources: "\u8FD8\u6CA1\u6709\u914D\u7F6E\u501F\u7528\u6765\u6E90\u3002",
2654
2657
  modelShareAddGrant: "\u6DFB\u52A0\u89C4\u5219",
2655
2658
  modelShareRemove: "\u5220\u9664",
@@ -2663,7 +2666,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2663
2666
  modelShareSaved: "\u6A21\u578B\u5171\u4EAB\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\u3002",
2664
2667
  modelShareSelectProvider: "\u9009\u62E9\u63D0\u4F9B\u5546",
2665
2668
  modelShareSelectModels: "\u9009\u62E9\u6A21\u578B",
2666
- modelShareBorrowFrom: "\u501F\u7528\u81EA",
2669
+ modelShareBorrowFrom: "\u501F\u7528\u81EA {name}",
2667
2670
  modelShareOffline: "\u79BB\u7EBF",
2668
2671
  modelShareOnline: "\u5728\u7EBF",
2669
2672
  modelShareNotLoaded: "\u6A21\u578B\u5171\u4EAB\u8BBE\u7F6E\u4E0D\u53EF\u7528\u3002",
@@ -2672,12 +2675,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2672
2675
  modelShareBorrowStatusDisconnected: "\u672A\u8FDE\u63A5\u5230\u8FDC\u7A0B\uFF1A\u501F\u7528\u65E0\u6CD5\u540C\u6B65\u3002",
2673
2676
  modelShareBorrowStatusFailed: "\u8FDE\u63A5\u5931\u8D25\uFF1A{reason}",
2674
2677
  modelShareBorrowStatusPeerEmpty: "\u8BE5\u8BBE\u5907\u5F53\u524D\u6CA1\u6709\u53EF\u501F\u7528\u7684\u6A21\u578B\u3002",
2675
- modelShareRuleAnyDeviceHint: "\u672A\u9009\u62E9\u4EFB\u4F55\u8BBE\u5907\u7684\u89C4\u5219\u5BF9\u6240\u6709\u5DF2\u6388\u6743\u7684\u8BBE\u5907\u751F\u6548\u3002",
2678
+ modelShareRuleAnyDeviceHint: "\u5171\u4EAB\u7684\u6A21\u578B\u4F1A\u63D0\u4F9B\u7ED9\u88AB\u5141\u8BB8\u8FDC\u7A0B\u63A7\u5236\u672C\u673A\u7684\u8BBE\u5907\u3002\u5173\u95ED\u300C\u5141\u8BB8\u88AB\u63A7\u300D\u5373\u53EF\u505C\u6B62\u5171\u4EAB\u3002",
2676
2679
  modelShareEdit: "\u7F16\u8F91",
2677
2680
  modelShareSaveEdit: "\u4FDD\u5B58\u89C4\u5219",
2678
2681
  modelShareSelectModelsHint: "\u5C1A\u672A\u9009\u62E9\u6A21\u578B",
2679
2682
  modelShareClearDraft: "\u6E05\u7A7A\u8868\u5355",
2680
- // [model-sharing] END
2681
2683
  modelShareBorrowStatusHostDisabled: "\u5BF9\u65B9\u5F53\u524D\u6CA1\u6709\u5411\u4F60\u501F\u51FA\uFF08\u5BF9\u65B9\u7684\u6A21\u578B\u5171\u4EAB\u5DF2\u5173\u95ED\uFF0C\u6216\u6CA1\u6709\u8986\u76D6\u672C\u8BBE\u5907\u7684\u89C4\u5219\uFF09\u3002\u8BF7\u5BF9\u65B9\u68C0\u67E5\u5176\u501F\u51FA\u89C4\u5219\u3002"
2682
2684
  }, ru = {
2683
2685
  downloadRemoteOriginal: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0441 \u0443\u0434\u0430\u043B\u0451\u043D\u043D\u043E\u0433\u043E \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430",
@@ -3091,7 +3093,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3091
3093
  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",
3092
3094
  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",
3093
3095
  codexVirtualSessions: "\u0421\u0435\u0441\u0441\u0438\u0438",
3094
- // [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
3096
+ // model-sharing strings, appended after upstream's last key.
3095
3097
  modelSharing: "\u041E\u0431\u043C\u0435\u043D \u043C\u043E\u0434\u0435\u043B\u044F\u043C\u0438",
3096
3098
  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.",
3097
3099
  modelShareLending: "\u041F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
@@ -3099,7 +3101,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3099
3101
  modelShareBorrowing: "\u0417\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u043D\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
3100
3102
  modelShareBorrowingHint: "\u041C\u043E\u0434\u0435\u043B\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0432\u0430\u0448\u0435\u043C \u0432\u044B\u0431\u043E\u0440\u0435 \u043C\u043E\u0434\u0435\u043B\u0435\u0439.",
3101
3103
  modelShareEnableLending: "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
3102
- modelShareNoGrants: "\u041C\u043E\u0434\u0435\u043B\u0438 \u0435\u0449\u0451 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u044B.",
3104
+ modelShareNoGrants: "\u041D\u0435\u0442 \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0445 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u0434\u043B\u044F \u043E\u0431\u0449\u0435\u0433\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u0430.",
3105
+ modelShareNoLocalModels: "\u041D\u0435\u0442 \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0445 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u0434\u043B\u044F \u043E\u0431\u0449\u0435\u0433\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u0430.",
3106
+ modelShareRefresh: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C",
3103
3107
  modelShareNoSources: "\u0417\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u043D\u0438\u0435 \u0435\u0449\u0451 \u043D\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D\u043E.",
3104
3108
  modelShareAddGrant: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3105
3109
  modelShareRemove: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
@@ -3113,7 +3117,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3113
3117
  modelShareSaved: "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043E\u0431\u043C\u0435\u043D\u0430 \u043C\u043E\u0434\u0435\u043B\u044F\u043C\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B.",
3114
3118
  modelShareSelectProvider: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430",
3115
3119
  modelShareSelectModels: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u0438",
3116
- modelShareBorrowFrom: "\u0417\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0438\u0437",
3120
+ modelShareBorrowFrom: "\u0417\u0430\u0438\u043C\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0438\u0437 {name}",
3117
3121
  modelShareOffline: "\u043E\u0444\u043B\u0430\u0439\u043D",
3118
3122
  modelShareOnline: "\u043E\u043D\u043B\u0430\u0439\u043D",
3119
3123
  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.",
@@ -3122,12 +3126,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3122
3126
  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.",
3123
3127
  modelShareBorrowStatusFailed: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F: {reason}",
3124
3128
  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.",
3125
- 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.",
3129
+ modelShareRuleAnyDeviceHint: "\u041E\u0431\u0449\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430\u043C, \u043A\u043E\u0442\u043E\u0440\u044B\u043C \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E \u0443\u0434\u0430\u043B\u0451\u043D\u043D\u043E \u0443\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u044D\u0442\u0438\u043C \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E\u043C. \u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u044D\u0442\u043E \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u0435\u043A\u0440\u0430\u0442\u0438\u0442\u044C \u043E\u0431\u0449\u0438\u0439 \u0434\u043E\u0441\u0442\u0443\u043F.",
3126
3130
  modelShareEdit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
3127
3131
  modelShareSaveEdit: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3128
3132
  modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u044B",
3129
3133
  modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u043E\u0440\u043C\u0443",
3130
- // [model-sharing] END
3131
3134
  modelShareBorrowStatusHostDisabled: "\u0414\u0440\u0443\u0433\u043E\u0435 \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\u0438 \u044D\u0442\u043E\u043C\u0443 \u043A\u043E\u043C\u043F\u044C\u044E\u0442\u0435\u0440\u0443 (\u043E\u0431\u0449\u0438\u0439 \u0434\u043E\u0441\u0442\u0443\u043F \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D \u0438\u043B\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E \u043D\u0435 \u043E\u0445\u0432\u0430\u0442\u044B\u0432\u0430\u0435\u0442 \u044D\u0442\u043E \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E). \u041F\u043E\u043F\u0440\u043E\u0441\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u0430."
3132
3135
  }, uk = {
3133
3136
  downloadRemoteOriginal: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043E\u0440\u0438\u0433\u0456\u043D\u0430\u043B \u0456\u0437 \u0432\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u043E\u0433\u043E \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u044E",
@@ -3541,7 +3544,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3541
3544
  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",
3542
3545
  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",
3543
3546
  codexVirtualSessions: "\u0421\u0435\u0441\u0456\u0457",
3544
- // [model-sharing] BEGIN — model-sharing strings, appended after upstream's last key.
3547
+ // model-sharing strings, appended after upstream's last key.
3545
3548
  modelSharing: "\u041C\u043E\u0434\u0435\u043B\u044C\u043D\u0438\u0439 \u043E\u0431\u043C\u0456\u043D",
3546
3549
  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.",
3547
3550
  modelShareLending: "\u041D\u0430\u0434\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
@@ -3549,7 +3552,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3549
3552
  modelShareBorrowing: "\u041F\u043E\u0437\u0438\u0447\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
3550
3553
  modelShareBorrowingHint: "\u041C\u043E\u0434\u0435\u043B\u0456 \u0437 \u0456\u043D\u0448\u0438\u0445 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0457\u0432 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u0443 \u0432\u0430\u0448\u043E\u043C\u0443 \u0432\u0438\u0431\u043E\u0440\u0456 \u043C\u043E\u0434\u0435\u043B\u0435\u0439.",
3551
3554
  modelShareEnableLending: "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u043D\u0430\u0434\u0430\u043D\u043D\u044F \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
3552
- modelShareNoGrants: "\u041C\u043E\u0434\u0435\u043B\u0456 \u0449\u0435 \u043D\u0435 \u043D\u0430\u0434\u0430\u043D\u0456.",
3555
+ modelShareNoGrants: "\u041D\u0435\u043C\u0430\u0454 \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u0438\u0445 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u0434\u043B\u044F \u0441\u043F\u0456\u043B\u044C\u043D\u043E\u0433\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u0443.",
3556
+ modelShareNoLocalModels: "\u041D\u0435\u043C\u0430\u0454 \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u0438\u0445 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u0434\u043B\u044F \u0441\u043F\u0456\u043B\u044C\u043D\u043E\u0433\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u0443.",
3557
+ modelShareRefresh: "\u041E\u043D\u043E\u0432\u0438\u0442\u0438",
3553
3558
  modelShareNoSources: "\u041F\u043E\u0437\u0438\u0447\u0430\u043D\u043D\u044F \u0449\u0435 \u043D\u0435 \u043D\u0430\u043B\u0430\u0448\u0442\u043E\u0432\u0430\u043D\u043E.",
3554
3559
  modelShareAddGrant: "\u0414\u043E\u0434\u0430\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3555
3560
  modelShareRemove: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
@@ -3563,7 +3568,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3563
3568
  modelShareSaved: "\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 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E.",
3564
3569
  modelShareSelectProvider: "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430",
3565
3570
  modelShareSelectModels: "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043C\u043E\u0434\u0435\u043B\u0456",
3566
- modelShareBorrowFrom: "\u041F\u043E\u0437\u0438\u0447\u0430\u0442\u0438 \u0437",
3571
+ modelShareBorrowFrom: "\u041F\u043E\u0437\u0438\u0447\u0430\u0442\u0438 \u0437 {name}",
3567
3572
  modelShareOffline: "\u043E\u0444\u043B\u0430\u0439\u043D",
3568
3573
  modelShareOnline: "\u043E\u043D\u043B\u0430\u0439\u043D",
3569
3574
  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.",
@@ -3572,12 +3577,11 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3572
3577
  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.",
3573
3578
  modelShareBorrowStatusFailed: "\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044F: {reason}",
3574
3579
  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.",
3575
- 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.",
3580
+ modelShareRuleAnyDeviceHint: "\u0421\u043F\u0456\u043B\u044C\u043D\u0456 \u043C\u043E\u0434\u0435\u043B\u0456 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u044F\u043C, \u044F\u043A\u0438\u043C \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u043E \u0432\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u043E \u043A\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0446\u0438\u043C \u043F\u0440\u0438\u0441\u0442\u0440\u043E\u0454\u043C. \u0412\u0438\u043C\u043A\u043D\u0456\u0442\u044C \u0446\u0435\u0439 \u0434\u043E\u0437\u0432\u0456\u043B, \u0449\u043E\u0431 \u043F\u0440\u0438\u043F\u0438\u043D\u0438\u0442\u0438 \u0441\u043F\u0456\u043B\u044C\u043D\u0438\u0439 \u0434\u043E\u0441\u0442\u0443\u043F.",
3576
3581
  modelShareEdit: "\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",
3577
3582
  modelShareSaveEdit: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3578
3583
  modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0456 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",
3579
3584
  modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u043E\u0440\u043C\u0443",
3580
- // [model-sharing] END
3581
3585
  modelShareBorrowStatusHostDisabled: "\u0406\u043D\u0448\u0438\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\u0456 \u0446\u044C\u043E\u043C\u0443 \u043A\u043E\u043C\u043F\u2019\u044E\u0442\u0435\u0440\u0443 (\u0441\u043F\u0456\u043B\u044C\u043D\u0438\u0439 \u0434\u043E\u0441\u0442\u0443\u043F \u0432\u0438\u043C\u043A\u043D\u0435\u043D\u043E \u0430\u0431\u043E \u043F\u0440\u0430\u0432\u0438\u043B\u043E \u043D\u0435 \u043E\u0445\u043E\u043F\u043B\u044E\u0454 \u0446\u0435\u0439 \u043F\u0440\u0438\u0441\u0442\u0440\u0456\u0439). \u041F\u043E\u043F\u0440\u043E\u0441\u0456\u0442\u044C \u0439\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u0430."
3582
3586
  };
3583
3587
 
@@ -4091,6 +4095,139 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4091
4095
  return snapshot.baselinesReady === !0 || snapshot.phase === "ready";
4092
4096
  }
4093
4097
 
4098
+ // packages/plugin/src/client/host-mention.ts
4099
+ init_page_globals();
4100
+ var DEFAULT_RETRY_DELAYS_MS = [1e3, 2e3, 5e3, 1e4, 3e4];
4101
+ function isUnsupportedSettingsEndpointError(reason) {
4102
+ if (typeof reason != "object" || reason === null || !("code" in reason)) return !1;
4103
+ let code = reason.code;
4104
+ return code === "METHOD_NOT_FOUND" || code === "METHOD_NOT_ALLOWED" || code === "FEATURE_NOT_SUPPORTED";
4105
+ }
4106
+ function createSource(deps, settingsSupport) {
4107
+ return {
4108
+ trigger: "@",
4109
+ name: "\u4E3B\u673A",
4110
+ order: -20,
4111
+ showGroupTitle: !1,
4112
+ candidates: async (_session, request) => {
4113
+ if (deps.remoteTools.read() === !1 || request.signal?.aborted) return [];
4114
+ if (!settingsSupport.unsupported) {
4115
+ let settings;
4116
+ try {
4117
+ settings = await deps.control("settings.get");
4118
+ } catch (reason) {
4119
+ if (request.signal?.aborted || deps.remoteTools.read() === !1) return [];
4120
+ if (!isUnsupportedSettingsEndpointError(reason)) return [];
4121
+ settingsSupport.unsupported = !0, deps.remoteTools.read() === void 0 && deps.remoteTools.publish(!0);
4122
+ }
4123
+ if (request.signal?.aborted || deps.remoteTools.read() === !1) return [];
4124
+ if (settings !== void 0) {
4125
+ let nextEnabled = settings.config?.remoteTools?.enabled !== !1;
4126
+ if (deps.remoteTools.publish(nextEnabled), !nextEnabled) return [];
4127
+ }
4128
+ }
4129
+ let devices = await deps.control("devices").catch(() => []);
4130
+ if (request.signal?.aborted || deps.remoteTools.read() === !1) return [];
4131
+ let query = request.query.trim().toLocaleLowerCase(), section = deps.t("host");
4132
+ return devices.filter((device) => device.online && (query === "" || `${device.name} ${device.deviceId}`.toLocaleLowerCase().includes(query))).map((device) => (deps.hostCache.set(device.name, device), {
4133
+ name: device.name,
4134
+ label: device.name,
4135
+ description: deps.t("remoteHostMention", { platform: device.platform }),
4136
+ icon: deps.icon,
4137
+ section,
4138
+ value: JSON.stringify({ deviceId: device.deviceId, label: device.name, platform: device.platform })
4139
+ }));
4140
+ },
4141
+ onPick: (pick) => {
4142
+ let host = JSON.parse(pick.candidate.value);
4143
+ return { text: `@${host.label} (Remote hostId=${JSON.stringify(host.deviceId)}) ` };
4144
+ }
4145
+ };
4146
+ }
4147
+ function installRemoteHostMentionSource(options) {
4148
+ if (options.isHostcTunnel) return () => {
4149
+ };
4150
+ let hostCache = options.hostCache ?? /* @__PURE__ */ new Map(), retryDelaysMs = options.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS, settingsSupport = { unsupported: !1 }, source = createSource({
4151
+ control: options.control,
4152
+ remoteTools: options.remoteTools,
4153
+ t: options.t,
4154
+ icon: options.icon,
4155
+ hostCache
4156
+ }, settingsSupport), disposed = !1, unregisterSource, clickBound = !1, probing = !1, retryIndex = 0, retryTimer, preferenceVersion = 0, lastStatusRemoteToolsEnabled, wasControlUnavailable = !1, stopHostFileOpen = (event) => {
4157
+ if (typeof Element > "u") return;
4158
+ let target = event.target instanceof Element ? event.target.closest('button,[role="button"],a') ?? event.target : void 0;
4159
+ if (!(target instanceof Element)) return;
4160
+ let text = target.textContent?.trim().replace(/^@/, "") ?? "", device = hostCache.get(text);
4161
+ if (!device) return;
4162
+ event.preventDefault(), event.stopImmediatePropagation();
4163
+ let invocation = `@${device.name}`, container = target;
4164
+ for (let depth = 0; depth < 20 && container !== null; depth += 1) {
4165
+ let candidate = container.textContent?.trim() ?? "";
4166
+ candidate.includes(device.name) && candidate.length > invocation.length && candidate.length < 4e3 && (invocation = candidate), container = container.parentElement;
4167
+ }
4168
+ typeof page < "u" && typeof CustomEvent < "u" && page.dispatchEvent(new CustomEvent("dsh-remote-host-reference", {
4169
+ detail: { label: device.name, platform: device.platform, deviceId: device.deviceId, invocation }
4170
+ }));
4171
+ }, mount = () => {
4172
+ disposed || unregisterSource !== void 0 || (!clickBound && typeof pageDocument < "u" && typeof pageDocument.addEventListener == "function" && (pageDocument.addEventListener("click", stopHostFileOpen, !0), clickBound = !0), unregisterSource = options.inputTriggers.registerSource(source));
4173
+ }, unmount = () => {
4174
+ if (clickBound && typeof pageDocument < "u" && typeof pageDocument.removeEventListener == "function" && (pageDocument.removeEventListener("click", stopHostFileOpen, !0), clickBound = !1), unregisterSource !== void 0) {
4175
+ let unregister = unregisterSource;
4176
+ unregisterSource = void 0, unregister();
4177
+ }
4178
+ hostCache.clear();
4179
+ }, clearRetryTimer = () => {
4180
+ retryTimer !== void 0 && (clearTimeout(retryTimer), retryTimer = void 0);
4181
+ }, sync = () => {
4182
+ let enabled = options.remoteTools.read();
4183
+ enabled === !0 ? (clearRetryTimer(), mount()) : enabled === !1 && (clearRetryTimer(), unmount());
4184
+ }, scheduleRetryTimer = () => {
4185
+ if (!(disposed || options.remoteTools.read() !== void 0) && retryTimer === void 0 && retryIndex < retryDelaysMs.length) {
4186
+ let delayMs = retryDelaysMs[retryIndex++];
4187
+ retryTimer = setTimeout(() => {
4188
+ retryTimer = void 0, probe(!1);
4189
+ }, delayMs);
4190
+ }
4191
+ }, probe = async (force = !1) => {
4192
+ if (disposed || probing || !force && options.remoteTools.read() !== void 0) return;
4193
+ probing = !0;
4194
+ let startVersion = preferenceVersion, shouldRetry = !1;
4195
+ try {
4196
+ let settings = await options.control("settings.get");
4197
+ if (disposed || preferenceVersion !== startVersion) return;
4198
+ clearRetryTimer(), options.remoteTools.publish(settings?.config?.remoteTools?.enabled !== !1);
4199
+ } catch (reason) {
4200
+ if (disposed || preferenceVersion !== startVersion) return;
4201
+ isUnsupportedSettingsEndpointError(reason) ? (settingsSupport.unsupported = !0, clearRetryTimer(), options.remoteTools.read() === void 0 && options.remoteTools.publish(!0)) : options.remoteTools.read() === void 0 && (shouldRetry = !0);
4202
+ } finally {
4203
+ probing = !1;
4204
+ }
4205
+ shouldRetry && scheduleRetryTimer();
4206
+ }, unsubscribePreference = options.remoteTools.subscribe(() => {
4207
+ preferenceVersion += 1, sync();
4208
+ }), ignoreInitialStatusReplay = !0, unsubscribeStatus = options.statusFeed.subscribe((status) => {
4209
+ if (disposed) return;
4210
+ if (status.controlUnavailable === !0) {
4211
+ wasControlUnavailable = !0, ignoreInitialStatusReplay = !1;
4212
+ return;
4213
+ }
4214
+ let recoveredFromUnavailable = wasControlUnavailable;
4215
+ if (wasControlUnavailable = !1, typeof status.remoteToolsEnabled == "boolean") {
4216
+ let previousStatusValue = lastStatusRemoteToolsEnabled;
4217
+ lastStatusRemoteToolsEnabled = status.remoteToolsEnabled, clearRetryTimer(), (options.remoteTools.read() === void 0 || previousStatusValue !== void 0 && previousStatusValue !== status.remoteToolsEnabled || previousStatusValue === void 0 && !ignoreInitialStatusReplay && options.remoteTools.read() !== status.remoteToolsEnabled) && options.remoteTools.publish(status.remoteToolsEnabled), ignoreInitialStatusReplay = !1;
4218
+ return;
4219
+ }
4220
+ if (ignoreInitialStatusReplay) {
4221
+ ignoreInitialStatusReplay = !1;
4222
+ return;
4223
+ }
4224
+ (options.remoteTools.read() === void 0 || recoveredFromUnavailable) && probe(recoveredFromUnavailable);
4225
+ });
4226
+ return ignoreInitialStatusReplay = !1, options.remoteTools.read() !== void 0 ? sync() : probe(!1), () => {
4227
+ disposed = !0, clearRetryTimer(), unsubscribeStatus(), unsubscribePreference(), unmount();
4228
+ };
4229
+ }
4230
+
4094
4231
  // packages/plugin/src/client/progress.ts
4095
4232
  init_page_globals();
4096
4233
  function createRemoteProgressView(React) {
@@ -4387,7 +4524,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4387
4524
  }
4388
4525
  function createModelSharingSection(React) {
4389
4526
  return function(props) {
4390
- 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), [draftModels, setDraftModels] = React.useState([]), [draftDevices, setDraftDevices] = React.useState([]), [draftAnyDevice, setDraftAnyDevice] = React.useState(!0), [editingIndex, setEditingIndex] = React.useState(void 0), [concurrencyDraft, setConcurrencyDraft] = React.useState(void 0), viewRef = React.useRef(void 0), queueRef = React.useRef(Promise.resolve()), busyRef = React.useRef(!1), applyView = (next) => {
4527
+ 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), [concurrencyDraft, setConcurrencyDraft] = React.useState(void 0), viewRef = React.useRef(void 0), queueRef = React.useRef(Promise.resolve()), busyRef = React.useRef(!1), applyView = (next) => {
4391
4528
  viewRef.current = next, setView(next), setConcurrencyDraft(void 0);
4392
4529
  }, load = React.useCallback(async () => {
4393
4530
  setError(void 0);
@@ -4416,34 +4553,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4416
4553
  enqueue((current) => ({ ...current, host: { ...current.host, ...changes } }));
4417
4554
  }, patchSources = (sources) => {
4418
4555
  enqueue((current) => ({ ...current, borrower: { ...current.borrower, sources } }));
4419
- }, toggleDraftModel = (route) => {
4420
- setDraftModels((current) => current.includes(route) ? current.filter((id) => id !== route) : [...current, route]);
4421
- }, toggleDraftDevice = (deviceId) => {
4422
- setDraftDevices((current) => current.includes(deviceId) ? current.filter((id) => id !== deviceId) : [...current, deviceId]);
4423
- }, resetDraft = () => {
4424
- setDraftModels([]), setDraftDevices([]), setDraftAnyDevice(!0), setEditingIndex(void 0);
4425
- }, saveRule = () => {
4426
- view === void 0 || draftModels.length === 0 || (enqueue((current) => {
4427
- let rules = [...current.host.rules], rule = {
4428
- models: [...draftModels],
4429
- devices: draftAnyDevice || draftDevices.length === 0 ? [] : [...draftDevices]
4430
- };
4431
- return editingIndex !== void 0 && editingIndex < rules.length ? rules[editingIndex] = rule : rules.push(rule), { ...current, host: { ...current.host, rules, enabled: !0 } };
4432
- }), resetDraft());
4433
- }, startEdit = (index) => {
4434
- let rule = view?.store.host.rules[index];
4435
- rule !== void 0 && (setDraftModels([...rule.models]), setDraftDevices([...rule.devices]), setDraftAnyDevice(rule.devices.length === 0), setEditingIndex(index));
4436
- }, removeRule = (index) => {
4437
- view !== void 0 && (editingIndex === index && resetDraft(), patchHost({ rules: view.store.host.rules.filter((_, i) => i !== index) }));
4438
- }, 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, ruleSummary = (rule) => [
4439
- rule.models.map((route) => {
4440
- let separator = route.indexOf(ROUTE_SEPARATOR), provider = route.slice(0, separator), model = route.slice(separator + ROUTE_SEPARATOR.length), providerName = view?.localProviders.find((candidate) => candidate.id === provider)?.name ?? provider;
4441
- if (model === "*") return `${providerName}: ${t("modelShareAllModels")}`;
4442
- let modelName = view?.localProviders.find((candidate) => candidate.id === provider)?.models.find((candidate) => candidate.id === model)?.name;
4443
- return `${providerName} / ${modelName ?? model}`;
4444
- }).join(", "),
4445
- rule.devices.length === 0 ? t("modelShareAnyDevice") : rule.devices.map(peerName).join(", ")
4446
- ], borrowStatus = (deviceId, source) => {
4556
+ }, label = (device) => `${device.name}${device.online ? ` \xB7 ${t("modelShareOnline")}` : device.known ? ` \xB7 ${t("modelShareOffline")}` : ""}`, borrowStatus = (deviceId, source) => {
4447
4557
  if (view === void 0 || source?.enabled !== !0) return;
4448
4558
  let diagnostics = view.borrowerDiagnostics;
4449
4559
  if (diagnostics.syncAvailable !== !0)
@@ -4474,7 +4584,15 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4474
4584
  React.createElement("p", null, error ?? t("modelShareNotLoaded"))
4475
4585
  )
4476
4586
  );
4477
- let { host, borrower } = view.store, disabled = busy || !view.writable || !available, selectedCount = draftModels.length, modelsSummary = selectedCount === 0 ? t("modelShareSelectModelsHint") : t("modelShareSelectedCount", { count: selectedCount }), devicesSummary = draftAnyDevice || draftDevices.length === 0 ? t("modelShareAnyDevice") : t("modelShareSelectedCount", { count: draftDevices.length }), deviceSummaryLine = `${t("modelShareDevice")}: ${devicesSummary}`, modelSummaryLine = `${t("modelShareModels")}: ${modelsSummary}`, lendingRows = React.createElement(
4587
+ let { host, borrower } = view.store, disabled = busy || !view.writable || !available, toggleShared = (route) => {
4588
+ let current = viewRef.current?.store.host.models ?? [];
4589
+ patchHost({
4590
+ models: current.includes(route) ? current.filter((model) => model !== route) : [...current, route]
4591
+ });
4592
+ }, toggleProvider = (provider) => {
4593
+ let current = viewRef.current?.store.host.models ?? [], routes = provider.models.map((model) => `${provider.id}${ROUTE_SEPARATOR}${model.id}`), next = routes.length > 0 && routes.every((route) => current.includes(route)) ? current.filter((route) => !routes.includes(route)) : [.../* @__PURE__ */ new Set([...current, ...routes])];
4594
+ patchHost({ models: next });
4595
+ }, sharedCount = host.models.length, modelSummaryLine = sharedCount === 0 ? t("modelShareSelectModelsHint") : t("modelShareSelectedCount", { count: sharedCount }), lendingRows = React.createElement(
4478
4596
  "div",
4479
4597
  { className: "dshRemoteAcpList" },
4480
4598
  React.createElement(
@@ -4509,135 +4627,60 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4509
4627
  ),
4510
4628
  React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareRuleAnyDeviceHint"))
4511
4629
  ),
4512
- ...host.rules.map((rule, index) => React.createElement(
4513
- "div",
4514
- {
4515
- key: `rule-${index}`,
4516
- className: "dshRemoteModelShareGrantEntry"
4517
- },
4518
- React.createElement("span", null, ruleSummary(rule).join(" \xB7 ")),
4519
- React.createElement(
4520
- "div",
4521
- { className: "dshRemoteAcpRowActions" },
4522
- React.createElement("button", {
4523
- type: "button",
4524
- className: "dshRemoteAcpActionBtn",
4525
- disabled,
4526
- "aria-label": `${t("modelShareEdit")} #${index + 1}`,
4527
- onClick: () => startEdit(index)
4528
- }, t("modelShareEdit")),
4529
- React.createElement("button", {
4530
- type: "button",
4531
- className: "dshRemoteAcpRemoveBtn",
4532
- disabled,
4533
- "aria-label": `${t("modelShareRemove")} #${index + 1}`,
4534
- onClick: () => removeRule(index)
4535
- }, t("modelShareRemove"))
4536
- )
4537
- )),
4538
- host.rules.length === 0 ? React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareNoGrants")) : null,
4539
- React.createElement(
4540
- "div",
4541
- { className: "dshRemoteAcpAddForm" },
4542
- React.createElement(
4630
+ view.localProviders.length === 0 ? React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareNoLocalModels")) : null,
4631
+ ...view.localProviders.map((provider) => {
4632
+ let routes = provider.models.map((model) => `${provider.id}${ROUTE_SEPARATOR}${model.id}`), allShared = routes.length > 0 && routes.every((route) => host.models.includes(route)), someShared = routes.some((route) => host.models.includes(route));
4633
+ return React.createElement(
4543
4634
  "div",
4544
- { className: "dshRemoteAcpAddInputs" },
4545
- React.createElement("button", {
4546
- type: "button",
4547
- className: "dshRemoteAcpAddTrigger",
4548
- disabled: disabled || draftModels.length === 0,
4549
- onClick: saveRule
4550
- }, t(editingIndex !== void 0 ? "modelShareSaveEdit" : "modelShareAddGrant")),
4551
- draftModels.length > 0 || draftDevices.length > 0 || editingIndex !== void 0 ? React.createElement("button", {
4552
- type: "button",
4553
- className: "dshRemoteAcpAddTrigger",
4554
- disabled,
4555
- onClick: resetDraft
4556
- }, t("modelShareClearDraft")) : null
4557
- ),
4558
- // One flat picker: every provider's models under provider headings,
4559
- // all selectable in a single pass. The heading checkbox adds that
4560
- // provider's wildcard route (all current models).
4561
- React.createElement(
4562
- "details",
4563
- { className: "dshRemoteModelSharePicker" },
4564
- React.createElement("summary", null, modelSummaryLine),
4565
- React.createElement(
4566
- "div",
4567
- { className: "dshRemoteModelSharePickerList", role: "group", "aria-label": t("modelShareModels") },
4568
- ...view.localProviders.map((provider) => {
4569
- let wildcard = `${provider.id}${ROUTE_SEPARATOR}*`;
4570
- return React.createElement(
4571
- "div",
4572
- { key: `prov-${provider.id}`, className: "dshRemoteModelShareProviderGroup" },
4573
- React.createElement(
4574
- "label",
4575
- { className: "dshRemoteModelShareProviderHeading" },
4576
- React.createElement("input", {
4577
- type: "checkbox",
4578
- checked: draftModels.includes(wildcard),
4579
- disabled,
4580
- "aria-label": `${t("modelShareAllModels")}: ${provider.name ?? provider.id}`,
4581
- onChange: () => toggleDraftModel(wildcard)
4582
- }),
4583
- React.createElement("strong", null, provider.name ?? provider.id)
4584
- ),
4585
- ...provider.models.map((model) => {
4586
- let route = `${provider.id}${ROUTE_SEPARATOR}${model.id}`;
4587
- return React.createElement(
4588
- "label",
4589
- { key: `model-${route}` },
4590
- React.createElement("input", {
4591
- type: "checkbox",
4592
- checked: draftModels.includes(route) || draftModels.includes(wildcard),
4593
- // The provider wildcard supersedes its individual boxes.
4594
- disabled: disabled || draftModels.includes(wildcard),
4595
- "aria-label": `${provider.name ?? provider.id} / ${model.name ?? model.id}`,
4596
- onChange: () => toggleDraftModel(route)
4597
- }),
4598
- model.name ?? model.id
4599
- );
4600
- })
4601
- );
4602
- })
4603
- )
4604
- ),
4605
- // Collapsible multi-device selection; empty means every peer.
4606
- React.createElement(
4607
- "details",
4608
- { className: "dshRemoteModelSharePicker" },
4609
- React.createElement("summary", null, deviceSummaryLine),
4635
+ {
4636
+ key: `prov-${provider.id}`,
4637
+ className: "dshRemoteAcpRow dshRemoteModelShareProviderRow"
4638
+ },
4610
4639
  React.createElement(
4611
4640
  "div",
4612
- { className: "dshRemoteModelSharePickerList", role: "group", "aria-label": t("modelShareDevice") },
4641
+ { className: "dshRemoteAcpRowMain" },
4613
4642
  React.createElement(
4614
4643
  "label",
4615
- null,
4644
+ { className: "dshRemoteModelShareProviderHeading" },
4616
4645
  React.createElement("input", {
4617
4646
  type: "checkbox",
4618
- checked: draftAnyDevice,
4647
+ checked: allShared,
4648
+ // Show a mixed provider as indeterminate rather than "off".
4649
+ ref: (node) => {
4650
+ node !== null && typeof node == "object" && "indeterminate" in node && (node.indeterminate = someShared && !allShared);
4651
+ },
4619
4652
  disabled,
4620
- "aria-label": t("modelShareAnyDevice"),
4621
- onChange: (event) => setDraftAnyDevice(event.target.checked)
4622
- }),
4623
- t("modelShareAnyDevice")
4624
- ),
4625
- ...view.peers.map((device) => React.createElement(
4626
- "label",
4627
- { key: `device-${device.deviceId}` },
4628
- React.createElement("input", {
4629
- type: "checkbox",
4630
- checked: draftDevices.includes(device.deviceId),
4631
- disabled: disabled || draftAnyDevice,
4632
- "aria-label": label(device),
4633
- onChange: () => toggleDraftDevice(device.deviceId)
4653
+ "aria-label": `${t("modelShareAllModels")}: ${provider.name ?? provider.id}`,
4654
+ onChange: () => toggleProvider(provider)
4634
4655
  }),
4635
- label(device)
4636
- ))
4656
+ React.createElement("strong", { className: "dshRemoteAcpName" }, provider.name ?? provider.id)
4657
+ )
4658
+ ),
4659
+ React.createElement(
4660
+ "div",
4661
+ { className: "dshRemoteModelSharePickerList", role: "group", "aria-label": provider.name ?? provider.id },
4662
+ ...provider.models.map((model) => {
4663
+ let route = `${provider.id}${ROUTE_SEPARATOR}${model.id}`;
4664
+ return React.createElement(
4665
+ "label",
4666
+ { key: `model-${route}`, className: "dshRemoteModelShareModelRow" },
4667
+ React.createElement("input", {
4668
+ type: "checkbox",
4669
+ checked: host.models.includes(route),
4670
+ disabled,
4671
+ "aria-label": `${provider.name ?? provider.id} / ${model.name ?? model.id}`,
4672
+ onChange: () => toggleShared(route)
4673
+ }),
4674
+ model.name ?? model.id
4675
+ );
4676
+ })
4637
4677
  )
4638
- )
4639
- )
4640
- ), borrowingRows = React.createElement(
4678
+ );
4679
+ }),
4680
+ React.createElement("p", { className: "dshRemoteAcpDiag" }, modelSummaryLine)
4681
+ ), refreshSources = () => {
4682
+ control("modelshare.resync").then((next) => applyView(next)).catch((reason) => setError(messageOf(reason, t)));
4683
+ }, borrowingRows = React.createElement(
4641
4684
  "div",
4642
4685
  { className: "dshRemoteAcpList" },
4643
4686
  ...view.peers.map((device) => {
@@ -4655,29 +4698,35 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4655
4698
  "div",
4656
4699
  { className: "dshRemoteAcpRowInfo" },
4657
4700
  React.createElement("strong", { className: "dshRemoteAcpName" }, label(device)),
4658
- React.createElement(
4659
- "p",
4660
- null,
4661
- `${t("modelShareBorrowFrom")} ${device.name}`
4662
- )
4701
+ React.createElement("p", null, t("modelShareBorrowFrom", { name: device.name }))
4663
4702
  ),
4664
- React.createElement("input", {
4665
- type: "checkbox",
4666
- role: "switch",
4667
- className: "dshRemoteSwitch",
4668
- checked: source?.enabled ?? !1,
4669
- "aria-checked": source?.enabled ?? !1,
4670
- disabled,
4671
- "aria-label": `${t("modelShareBorrowFrom")}: ${label(device)}`,
4672
- onChange: () => {
4673
- let sources = { ...borrower.sources };
4674
- sources[device.deviceId] = {
4675
- enabled: !(source?.enabled ?? !1),
4676
- models: source?.models ?? [],
4677
- hostName: source?.hostName ?? device.name
4678
- }, patchSources(sources);
4679
- }
4680
- })
4703
+ React.createElement(
4704
+ "div",
4705
+ { className: "dshRemoteAcpRowActions" },
4706
+ source?.enabled === !0 ? React.createElement("button", {
4707
+ type: "button",
4708
+ className: "dshRemoteAcpActionBtn",
4709
+ disabled,
4710
+ "aria-label": `${t("modelShareRefresh")}: ${label(device)}`,
4711
+ onClick: refreshSources
4712
+ }, t("modelShareRefresh")) : null,
4713
+ React.createElement("input", {
4714
+ type: "checkbox",
4715
+ role: "switch",
4716
+ className: "dshRemoteSwitch",
4717
+ checked: source?.enabled ?? !1,
4718
+ "aria-checked": source?.enabled ?? !1,
4719
+ disabled,
4720
+ "aria-label": `${t("modelShareBorrowFrom", { name: label(device) })}`,
4721
+ onChange: () => {
4722
+ let sources = { ...borrower.sources };
4723
+ sources[device.deviceId] = {
4724
+ enabled: !(source?.enabled ?? !1),
4725
+ hostName: source?.hostName ?? device.name
4726
+ }, patchSources(sources);
4727
+ }
4728
+ })
4729
+ )
4681
4730
  ),
4682
4731
  status !== void 0 ? React.createElement("p", {
4683
4732
  className: `dshRemoteAcpDiag${status.cls}`,
@@ -4685,7 +4734,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4685
4734
  }, status.text) : null
4686
4735
  );
4687
4736
  }),
4688
- Object.keys(borrower.sources).length === 0 ? React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareNoSources")) : null
4737
+ view.peers.length === 0 ? React.createElement("p", { className: "dshRemoteAcpDiag" }, t("modelShareNoSources")) : null
4689
4738
  );
4690
4739
  return React.createElement(
4691
4740
  "div",
@@ -4705,7 +4754,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4705
4754
  React.createElement(
4706
4755
  "span",
4707
4756
  { className: "dshRemoteAcpSummaryMeta" },
4708
- React.createElement("span", { className: "dshRemoteAcpCountText" }, String(host.rules.length)),
4757
+ React.createElement("span", { className: "dshRemoteAcpCountText" }, String(host.models.length)),
4709
4758
  Chevron(React)
4710
4759
  )
4711
4760
  ),
@@ -4770,7 +4819,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4770
4819
  subscribeStatus,
4771
4820
  getStatusSnapshot,
4772
4821
  getStatusSnapshot
4773
- ), [open, setOpen] = React.useState(props.view === "page"), [serverUrl, setServerUrl] = React.useState(""), [savingServer, setSavingServer] = React.useState(!1), [editingServer, setEditingServer] = React.useState(!1), serverDraftEdited = React.useRef(!1), [remoteToolsBusy, setRemoteToolsBusy] = React.useState(!1), [remoteToolsEnabled, setRemoteToolsEnabled] = React.useState(!0), [associations, setAssociations] = React.useState({}), [loaded, setLoaded] = React.useState(!1), [writable, setWritable] = React.useState(!1), [busy, setBusy] = React.useState(!1), [terminalEnabled, setTerminalEnabled] = React.useState(!1), [debugBusy, setDebugBusy] = React.useState(!1), [debugLogging, setDebugLogging] = React.useState(!1), [logsOpen, setLogsOpen] = React.useState(!1), [logsFilter, setLogsFilter] = React.useState("all"), [logsLoading, setLogsLoading] = React.useState(!1), [logsClearing, setLogsClearing] = React.useState(!1), [logsSnapshot, setLogsSnapshot] = React.useState(void 0), [logsError, setLogsError] = React.useState(void 0), [logsCopyState, setLogsCopyState] = React.useState("idle"), logsRequestRun = React.useRef(0), logsCopyTimer = React.useRef(void 0), logsViewportRef = React.useRef(null), [resetBusy, setResetBusy] = React.useState(!1), [retryStartupBusy, setRetryStartupBusy] = React.useState(!1), [terminalBusy, setTerminalBusy] = React.useState(!1), [sidebarEntry, setSidebarEntry] = React.useState(() => props.sidebarEntry?.read?.() ?? "standard"), [sidebarEntryBusy, setSidebarEntryBusy] = React.useState(!1), [acpBackends, setAcpBackends] = React.useState([]), [acpAvailability, setAcpAvailability] = React.useState({}), [acpDiagnostics, setAcpDiagnostics] = React.useState({}), [acpChecking, setAcpChecking] = React.useState({}), [acpInstalling, setAcpInstalling] = React.useState({}), [acpCheckResults, setAcpCheckResults] = React.useState({}), [newAcpId, setNewAcpId] = React.useState(""), [newAcpCommand, setNewAcpCommand] = React.useState(""), [newAcpArgs, setNewAcpArgs] = React.useState("acp"), [addingAcp, setAddingAcp] = React.useState(!1), [addAcpFormOpen, setAddAcpFormOpen] = React.useState(!1), [reconnectBusy, setReconnectBusy] = React.useState(!1), [hostStatus, setHostStatus] = React.useState(void 0), [hostName, setHostName] = React.useState(""), [hostDeviceId, setHostDeviceId] = React.useState(""), [notice, setNotice] = React.useState(void 0), [failure, setError] = React.useState(void 0), error = failure instanceof ControlRouteUnavailableError ? t("remoteControlUnavailable") : failure, reportError = (reason) => {
4822
+ ), [open, setOpen] = React.useState(props.view === "page"), [serverUrl, setServerUrl] = React.useState(""), [savingServer, setSavingServer] = React.useState(!1), [editingServer, setEditingServer] = React.useState(!1), serverDraftEdited = React.useRef(!1), [remoteToolsBusy, setRemoteToolsBusy] = React.useState(!1), [remoteToolsEnabled, setRemoteToolsEnabled] = React.useState(() => props.remoteTools?.read?.() ?? !0), [associations, setAssociations] = React.useState({}), [loaded, setLoaded] = React.useState(!1), [writable, setWritable] = React.useState(!1), [busy, setBusy] = React.useState(!1), [terminalEnabled, setTerminalEnabled] = React.useState(!1), [debugBusy, setDebugBusy] = React.useState(!1), [debugLogging, setDebugLogging] = React.useState(!1), [logsOpen, setLogsOpen] = React.useState(!1), [logsFilter, setLogsFilter] = React.useState("all"), [logsLoading, setLogsLoading] = React.useState(!1), [logsClearing, setLogsClearing] = React.useState(!1), [logsSnapshot, setLogsSnapshot] = React.useState(void 0), [logsError, setLogsError] = React.useState(void 0), [logsCopyState, setLogsCopyState] = React.useState("idle"), logsRequestRun = React.useRef(0), logsCopyTimer = React.useRef(void 0), logsViewportRef = React.useRef(null), [resetBusy, setResetBusy] = React.useState(!1), [retryStartupBusy, setRetryStartupBusy] = React.useState(!1), [terminalBusy, setTerminalBusy] = React.useState(!1), [sidebarEntry, setSidebarEntry] = React.useState(() => props.sidebarEntry?.read?.() ?? "standard"), [sidebarEntryBusy, setSidebarEntryBusy] = React.useState(!1), [acpBackends, setAcpBackends] = React.useState([]), [acpAvailability, setAcpAvailability] = React.useState({}), [acpDiagnostics, setAcpDiagnostics] = React.useState({}), [acpChecking, setAcpChecking] = React.useState({}), [acpInstalling, setAcpInstalling] = React.useState({}), [acpCheckResults, setAcpCheckResults] = React.useState({}), [newAcpId, setNewAcpId] = React.useState(""), [newAcpCommand, setNewAcpCommand] = React.useState(""), [newAcpArgs, setNewAcpArgs] = React.useState("acp"), [addingAcp, setAddingAcp] = React.useState(!1), [addAcpFormOpen, setAddAcpFormOpen] = React.useState(!1), [reconnectBusy, setReconnectBusy] = React.useState(!1), [hostStatus, setHostStatus] = React.useState(void 0), [hostName, setHostName] = React.useState(""), [hostDeviceId, setHostDeviceId] = React.useState(""), [notice, setNotice] = React.useState(void 0), [failure, setError] = React.useState(void 0), error = failure instanceof ControlRouteUnavailableError ? t("remoteControlUnavailable") : failure, reportError = (reason) => {
4774
4823
  setError(reason instanceof ControlRouteUnavailableError ? reason : messageOf(reason, t));
4775
4824
  }, [settingsView, setSettingsView] = React.useState(void 0), [signInOpen, setSignInOpen] = React.useState(!1), [loginEmail, setLoginEmail] = React.useState(""), [loginPassword, setLoginPassword] = React.useState(""), [loginMethod, setLoginMethod] = React.useState("password"), [oauthProviders, setOAuthProviders] = React.useState([]), [providersLoading, setProvidersLoading] = React.useState(!1), [providersFailed, setProvidersFailed] = React.useState(!1), [pairingServerUrl, setPairingServerUrl] = React.useState(void 0), [qrSession, setQrSession] = React.useState(void 0), [qrImage, setQrImage] = React.useState(void 0), [qrExpired, setQrExpired] = React.useState(!1), [qrFailed, setQrFailed] = React.useState(!1), [qrBusy, setQrBusy] = React.useState(!1), [qrCompleted, setQrCompleted] = React.useState(!1), [providerReload, setProviderReload] = React.useState(0), [completionReload, setCompletionReload] = React.useState(0), qrFlowRun = React.useRef(0), providerRequestRun = React.useRef(0), loginMethodManuallySelected = React.useRef(!1), associationReadRun = React.useRef(0), association = associations.client ?? associations.host;
4776
4825
  React.useEffect(() => {
@@ -4783,7 +4832,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4783
4832
  let applyAssociations = (view) => {
4784
4833
  setAssociations(view.associations ?? (view.association === void 0 ? {} : { host: view.association }));
4785
4834
  }, applyView = (view, updateAssociations = !0) => {
4786
- setError((current) => current instanceof ControlRouteUnavailableError ? void 0 : current), setSettingsView(view), serverDraftEdited.current || setServerUrl(view.config.serverUrl ?? "https://dsh.r2049.cn"), setTerminalEnabled(view.config.terminal?.enabled ?? !0), setDebugLogging(view.config.logLevel === "debug"), setRemoteToolsEnabled(view.config.remoteTools?.enabled ?? !0), setSidebarEntry(view.config.sidebar?.entry ?? "standard"), props.sidebarEntry?.publish(view.config.sidebar?.entry ?? "standard"), setAcpBackends((view.config.acp?.backends ?? []).map((item) => ({ id: item.id, enabled: item.enabled !== !1 }))), setAcpAvailability(view.acpAvailability ?? {}), setAcpDiagnostics(view.acpDiagnostics ?? {}), updateAssociations && applyAssociations(view), setWritable(view.writable), setLoaded(!0);
4835
+ setError((current) => current instanceof ControlRouteUnavailableError ? void 0 : current), setSettingsView(view), serverDraftEdited.current || setServerUrl(view.config.serverUrl ?? "https://dsh.r2049.cn"), setTerminalEnabled(view.config.terminal?.enabled ?? !0), setDebugLogging(view.config.logLevel === "debug");
4836
+ let nextRemoteToolsEnabled = view.config.remoteTools?.enabled !== !1;
4837
+ setRemoteToolsEnabled(nextRemoteToolsEnabled), props.remoteTools?.publish(nextRemoteToolsEnabled), setSidebarEntry(view.config.sidebar?.entry ?? "standard"), props.sidebarEntry?.publish(view.config.sidebar?.entry ?? "standard"), setAcpBackends((view.config.acp?.backends ?? []).map((item) => ({ id: item.id, enabled: item.enabled !== !1 }))), setAcpAvailability(view.acpAvailability ?? {}), setAcpDiagnostics(view.acpDiagnostics ?? {}), updateAssociations && applyAssociations(view), setWritable(view.writable), setLoaded(!0);
4787
4838
  };
4788
4839
  React.useEffect(() => {
4789
4840
  if (!(failure instanceof ControlRouteUnavailableError)) return;
@@ -5870,14 +5921,13 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
5870
5921
  sidebarEntrySetting,
5871
5922
  resetIdentitySetting,
5872
5923
  acpSetting,
5873
- // [model-sharing] BEGIN — model-share block inside the options list.
5874
- // [model-sharing] 专用的模型借出/借用配置区块。
5924
+ // model-share block inside the options list.
5925
+ // 专用的模型借出/借用配置区块。
5875
5926
  React.createElement(ModelSharingSection, {
5876
5927
  control: props.control,
5877
5928
  t,
5878
5929
  available: writable
5879
5930
  }),
5880
- // [model-sharing] END
5881
5931
  React.createElement(
5882
5932
  "div",
5883
5933
  { className: "dshRemoteAuthorizationSetting" },
@@ -5969,14 +6019,13 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
5969
6019
  sidebarEntrySetting,
5970
6020
  resetIdentitySetting,
5971
6021
  acpSetting,
5972
- // [model-sharing] BEGIN — model-share block inside the options list.
5973
- // [model-sharing] 专用的模型借出/借用配置区块。
6022
+ // model-share block inside the options list.
6023
+ // 专用的模型借出/借用配置区块。
5974
6024
  React.createElement(ModelSharingSection, {
5975
6025
  control: props.control,
5976
6026
  t,
5977
6027
  available: writable
5978
6028
  }),
5979
- // [model-sharing] END
5980
6029
  React.createElement(
5981
6030
  "div",
5982
6031
  { className: "dshRemoteSettingsSignIn" },
@@ -6089,15 +6138,13 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
6089
6138
  ".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)}",
6090
6139
  '.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)}',
6091
6140
  ".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)}",
6092
- // [model-sharing] BEGIN — the settings section reuses the ACP row classes;
6141
+ // the settings section reuses the ACP row classes;
6093
6142
  // this selector only adds the select / number controls it introduces.
6094
6143
  ".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}",
6095
- // [model-sharing] END
6096
6144
  ".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}}",
6097
- // [model-sharing] BEGIN — collapsible checkbox pickers and grant rows inside
6145
+ // collapsible checkbox pickers and grant rows inside
6098
6146
  // the model-share settings section; everything else reuses dshRemoteAcp*.
6099
6147
  '.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}}',
6100
- // [model-sharing] END
6101
6148
  ".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}",
6102
6149
  ".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)}",
6103
6150
  '.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}',
@@ -8306,7 +8353,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8306
8353
  }
8307
8354
  }
8308
8355
  function createStatusFeed(options) {
8309
- let listeners = /* @__PURE__ */ new Set(), pollIntervalMs = options.pollIntervalMs ?? 1500, openTimeoutMs = options.openTimeoutMs ?? 4e3, createSource = options.createSource ?? ((url) => new EventSource(url)), status, source, openTimer, pollTimer, publish = (next) => {
8356
+ let listeners = /* @__PURE__ */ new Set(), pollIntervalMs = options.pollIntervalMs ?? 1500, openTimeoutMs = options.openTimeoutMs ?? 4e3, createSource2 = options.createSource ?? ((url) => new EventSource(url)), status, source, openTimer, pollTimer, publish = (next) => {
8310
8357
  status = next;
8311
8358
  for (let listener of [...listeners]) listener(next);
8312
8359
  }, teardown = () => {
@@ -8321,7 +8368,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8321
8368
  }, openStream = () => {
8322
8369
  let opened;
8323
8370
  try {
8324
- opened = createSource(options.url);
8371
+ opened = createSource2(options.url);
8325
8372
  } catch {
8326
8373
  fallbackToPolling("unsupported");
8327
8374
  return;
@@ -8691,6 +8738,17 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8691
8738
  for (let listener of sidebarEntryListeners) listener();
8692
8739
  }
8693
8740
  }
8741
+ }, remoteToolsEnabled, remoteToolsListeners = /* @__PURE__ */ new Set(), remoteTools = {
8742
+ read: () => remoteToolsEnabled,
8743
+ subscribe: (listener) => (remoteToolsListeners.add(listener), () => {
8744
+ remoteToolsListeners.delete(listener);
8745
+ }),
8746
+ publish: (enabled) => {
8747
+ if (enabled !== remoteToolsEnabled) {
8748
+ remoteToolsEnabled = enabled;
8749
+ for (let listener of [...remoteToolsListeners]) listener();
8750
+ }
8751
+ }
8694
8752
  }, controlRouteRetryAfter = 0, controlRouteBackoffIndex = 0, control = async (endpoint, payload = {}) => {
8695
8753
  if (endpoint === "status" && (isHostcTunnel || Date.now() < controlRouteRetryAfter))
8696
8754
  return controlRouteUnavailableStatus();
@@ -8778,49 +8836,18 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8778
8836
  React.createElement("path", { d: "M5 14h6M8 11.5v2.5" })
8779
8837
  );
8780
8838
  if (ctx.inject(["inputTriggers"], (inputContext) => {
8781
- let hostCache = /* @__PURE__ */ new Map();
8782
8839
  inputContext.effect(() => {
8783
- let inputTriggers = inputContext.inputTriggers, source = {
8784
- trigger: "@",
8785
- name: "\u4E3B\u673A",
8786
- order: -20,
8787
- showGroupTitle: !0,
8788
- candidates: async (_session, request) => {
8789
- if ((await control("settings.get").catch(() => {
8790
- }))?.config?.remoteTools?.enabled === !1) return [];
8791
- let devices = await control("devices").catch(() => []), query = request.query.trim().toLocaleLowerCase();
8792
- return devices.filter((device) => device.online && (query === "" || `${device.name} ${device.deviceId}`.toLocaleLowerCase().includes(query))).map((device) => (hostCache.set(device.name, device), {
8793
- name: device.name,
8794
- label: device.name,
8795
- description: t("remoteHostMention", { platform: device.platform }),
8796
- icon: RemoteMentionIcon,
8797
- value: JSON.stringify({ deviceId: device.deviceId, label: device.name, platform: device.platform })
8798
- }));
8799
- },
8800
- onPick: (pick) => {
8801
- let host = JSON.parse(pick.candidate.value);
8802
- return { text: `@${host.label} (Remote hostId=${JSON.stringify(host.deviceId)}) ` };
8803
- }
8804
- }, stopHostFileOpen = (event) => {
8805
- let target = event.target instanceof Element ? event.target.closest('button,[role="button"],a') ?? event.target : void 0;
8806
- if (!(target instanceof Element)) return;
8807
- let text = target.textContent?.trim().replace(/^@/, "") ?? "", device = hostCache.get(text);
8808
- if (!device) return;
8809
- event.preventDefault(), event.stopImmediatePropagation();
8810
- let invocation = `@${device.name}`, container = target;
8811
- for (let depth = 0; depth < 20 && container !== null; depth += 1) {
8812
- let candidate = container.textContent?.trim() ?? "";
8813
- candidate.includes(device.name) && candidate.length > invocation.length && candidate.length < 4e3 && (invocation = candidate), container = container.parentElement;
8814
- }
8815
- page.dispatchEvent(new CustomEvent("dsh-remote-host-reference", {
8816
- detail: { label: device.name, platform: device.platform, deviceId: device.deviceId, invocation }
8817
- }));
8818
- };
8819
- pageDocument.addEventListener("click", stopHostFileOpen, !0);
8820
- let unregister = inputTriggers.registerSource(source);
8821
- return () => {
8822
- pageDocument.removeEventListener("click", stopHostFileOpen, !0), unregister();
8823
- };
8840
+ let inputTriggers = inputContext.get("inputTriggers") ?? inputContext.inputTriggers;
8841
+ return typeof inputTriggers?.registerSource != "function" ? () => {
8842
+ } : installRemoteHostMentionSource({
8843
+ inputTriggers,
8844
+ control,
8845
+ statusFeed,
8846
+ remoteTools,
8847
+ t,
8848
+ icon: RemoteMentionIcon,
8849
+ isHostcTunnel
8850
+ });
8824
8851
  }, "ds-harness-remote: host mention source");
8825
8852
  }), ctx.effect(() => ctx.locale.register(localeNamespace, { zh, en, ru, uk }), "ds-harness-remote: dictionaries"), ctx.effect(() => installStyle(clientModuleId), "ds-harness-remote: client styles"), ctx.effect(() => installTerminalAvailabilityNotice(statusFeed, t), "ds-harness-remote: terminal availability notice"), isHostcTunnel) {
8826
8853
  let WebFooter2 = function() {
@@ -8909,7 +8936,8 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8909
8936
  statusFeed,
8910
8937
  onSignIn: openRemote,
8911
8938
  preferredQrProvider: ctx.locale.getLocale().active === "zh" ? "zhihu" : "github",
8912
- sidebarEntry
8939
+ sidebarEntry,
8940
+ remoteTools
8913
8941
  })
8914
8942
  }, RemotePluginOptions)), ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
8915
8943
  name: "plugins.bundle.config",
@@ -8922,7 +8950,8 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
8922
8950
  statusFeed,
8923
8951
  onSignIn: openRemote,
8924
8952
  preferredQrProvider: ctx.locale.getLocale().active === "zh" ? "zhihu" : "github",
8925
- sidebarEntry
8953
+ sidebarEntry,
8954
+ remoteTools
8926
8955
  })
8927
8956
  }, RemotePluginOptions)), ctx.slots.inject("plugins.detail.actions", () => ctx.slots.register({
8928
8957
  name: "plugins.detail.actions",