@musdrop/ds-harness-remote 0.6.20 → 0.6.22

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
@@ -2226,8 +2226,9 @@ If a code was sent, recover the original submission without changing it.`,
2226
2226
  modelShareEdit: "Edit",
2227
2227
  modelShareSaveEdit: "Save rule",
2228
2228
  modelShareSelectModelsHint: "No models selected yet",
2229
- modelShareClearDraft: "Clear form"
2229
+ modelShareClearDraft: "Clear form",
2230
2230
  // [model-sharing] END
2231
+ 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."
2231
2232
  }, zh = {
2232
2233
  uploadTooLarge: "\u6587\u4EF6\u8D85\u8FC7\u5F53\u524D\u8FDE\u63A5\u7684\u5355\u6587\u4EF6\u4E0A\u4F20\u4E0A\u9650\uFF08{size}\uFF09\u3002",
2233
2234
  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",
@@ -2676,8 +2677,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
2676
2677
  modelShareEdit: "\u7F16\u8F91",
2677
2678
  modelShareSaveEdit: "\u4FDD\u5B58\u89C4\u5219",
2678
2679
  modelShareSelectModelsHint: "\u5C1A\u672A\u9009\u62E9\u6A21\u578B",
2679
- modelShareClearDraft: "\u6E05\u7A7A\u8868\u5355"
2680
+ modelShareClearDraft: "\u6E05\u7A7A\u8868\u5355",
2680
2681
  // [model-sharing] END
2682
+ 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"
2681
2683
  }, ru = {
2682
2684
  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}).",
2683
2685
  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.",
@@ -3126,8 +3128,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3126
3128
  modelShareEdit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
3127
3129
  modelShareSaveEdit: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3128
3130
  modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u044B",
3129
- modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u043E\u0440\u043C\u0443"
3131
+ modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u043E\u0440\u043C\u0443",
3130
3132
  // [model-sharing] END
3133
+ 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."
3131
3134
  }, uk = {
3132
3135
  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}).",
3133
3136
  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.",
@@ -3576,8 +3579,9 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
3576
3579
  modelShareEdit: "\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",
3577
3580
  modelShareSaveEdit: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
3578
3581
  modelShareSelectModelsHint: "\u041C\u043E\u0434\u0435\u043B\u0456 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",
3579
- modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u043E\u0440\u043C\u0443"
3582
+ modelShareClearDraft: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u0444\u043E\u0440\u043C\u0443",
3580
3583
  // [model-sharing] END
3584
+ 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."
3581
3585
  };
3582
3586
 
3583
3587
  // packages/plugin/src/client/header.ts
@@ -4453,6 +4457,7 @@ DSH Go \u626B\u7801\u6682\u4E0D\u652F\u6301\u591A\u53F0\u8BBE\u5907\u63A7\u5236\
4453
4457
  case "registered":
4454
4458
  return { cls: "", text: t("modelShareBorrowStatusOk", { count: entry.modelCount }) };
4455
4459
  case "host-disabled":
4460
+ return { cls: " isFailed", text: t("modelShareBorrowStatusHostDisabled") };
4456
4461
  case "no-models":
4457
4462
  return { cls: " isFailed", text: t("modelShareBorrowStatusPeerEmpty") };
4458
4463
  case "failed":
package/dist/index.js CHANGED
@@ -75387,7 +75387,7 @@ function parseIpv6(value) {
75387
75387
  }
75388
75388
 
75389
75389
  // packages/plugin/src/version.ts
75390
- var PLUGIN_VERSION = "0.6.20";
75390
+ var PLUGIN_VERSION = "0.6.22";
75391
75391
 
75392
75392
  // packages/plugin/src/server-api.ts
75393
75393
  var TERMINAL_CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f]/u;
@@ -126938,6 +126938,90 @@ function detachDirectoryEntry(entry) {
126938
126938
  };
126939
126939
  }
126940
126940
 
126941
+ // packages/plugin/src/model-share/failures.ts
126942
+ var BORROW_CODES = {
126943
+ /** The Remote connection to the lending Host is gone. */
126944
+ NOT_CONNECTED: "BORROW_NOT_CONNECTED",
126945
+ /** The RPC round-trip failed on the transport. */
126946
+ TRANSPORT: "BORROW_TRANSPORT_FAILED",
126947
+ /** The Host answered PERMISSION_DENIED for this route. */
126948
+ NOT_LENT: "BORROW_NOT_LENT",
126949
+ /** The Host is at its concurrent-stream limit. */
126950
+ BUSY: "BORROW_HOST_BUSY",
126951
+ /** The model disappeared from the Host catalog. */
126952
+ MODEL_GONE: "BORROW_MODEL_GONE",
126953
+ /** The Host answered with its own provider failure. */
126954
+ HOST_FAILED: "BORROW_HOST_FAILED",
126955
+ /** The Host reported no such stream (already closed / server restarted). */
126956
+ STREAM_GONE: "BORROW_STREAM_GONE"
126957
+ };
126958
+ function hostLabel(hostName, hostId) {
126959
+ const name2 = hostName.trim();
126960
+ return name2 === "" ? hostId : name2;
126961
+ }
126962
+ function explainHostRejection(error62, hostName, hostId, modelId) {
126963
+ const host = hostLabel(hostName, hostId);
126964
+ const remoteCode = error62?.code;
126965
+ const detail = error62 instanceof Error ? error62.message : typeof error62 === "string" ? error62 : "";
126966
+ const lower = detail.toLowerCase();
126967
+ if (remoteCode === "PERMISSION_DENIED" || lower.includes("not lent to this device")) {
126968
+ return {
126969
+ code: BORROW_CODES.NOT_LENT,
126970
+ message: `\u300C${host}\u300D\u4E0D\u518D\u628A\u8FD9\u4E2A\u6A21\u578B\u501F\u7ED9\u4F60\uFF08${modelId}\uFF09\u3002\u53EF\u80FD\u662F\u5BF9\u65B9\u4FEE\u6539\u6216\u5220\u9664\u4E86\u501F\u51FA\u89C4\u5219\uFF1B\u5728\u300C\u6A21\u578B\u5171\u4EAB \u2192 \u501F\u7528\u6A21\u578B\u300D\u91CC\u5173\u6389\u518D\u6253\u5F00\u8BE5\u8BBE\u5907\u4EE5\u5237\u65B0\u76EE\u5F55\uFF0C\u6216\u8BA9\u5BF9\u65B9\u786E\u8BA4\u89C4\u5219\u4ECD\u5305\u542B\u8FD9\u4E2A\u6A21\u578B\u3002`
126971
+ };
126972
+ }
126973
+ if (remoteCode === "RATE_LIMITED" || lower.includes("concurrent stream limit")) {
126974
+ return {
126975
+ code: BORROW_CODES.BUSY,
126976
+ message: `\u300C${host}\u300D\u7684\u5E76\u53D1\u6570\u5DF2\u6EE1\uFF08\u5BF9\u65B9\u8BBE\u7F6E\u4E86\u540C\u65F6\u5904\u7406\u7684\u8BF7\u6C42\u4E0A\u9650\uFF09\u3002\u7B49\u4E0A\u4E00\u6761\u56DE\u590D\u7ED3\u675F\u518D\u8BD5\uFF0C\u6216\u8BA9\u5BF9\u65B9\u628A\u300C\u6A21\u578B\u5171\u4EAB \u2192 \u501F\u51FA\u6A21\u578B \u2192 \u6700\u5927\u5E76\u53D1\u6570\u300D\u8C03\u9AD8\u3002`
126977
+ };
126978
+ }
126979
+ if (remoteCode === "FEATURE_NOT_SUPPORTED") {
126980
+ return {
126981
+ code: BORROW_CODES.NOT_LENT,
126982
+ message: `\u300C${host}\u300D\u4E0A\u7684\u6A21\u578B\u5171\u4EAB\u5DF2\u5173\u95ED\u3002\u8BF7\u5BF9\u65B9\u5728\u5176\u300C\u6A21\u578B\u5171\u4EAB\u300D\u91CC\u91CD\u65B0\u5F00\u542F\u501F\u51FA\u3002`
126983
+ };
126984
+ }
126985
+ if (remoteCode === "METHOD_NOT_FOUND") {
126986
+ return {
126987
+ code: BORROW_CODES.NOT_LENT,
126988
+ message: `\u300C${host}\u300D\u7684\u63D2\u4EF6\u7248\u672C\u8F83\u65E7\uFF0C\u4E0D\u652F\u6301\u6A21\u578B\u501F\u7528\u3002\u8BF7\u628A\u5BF9\u65B9\u8BBE\u5907\u7684 @musdrop/ds-harness-remote \u5347\u7EA7\u5230\u4E0E\u4F60\u8FD9\u53F0\u76F8\u540C\u7684\u7248\u672C\u3002`
126989
+ };
126990
+ }
126991
+ const suffix = detail === "" ? "" : `\uFF1A${detail}`;
126992
+ return {
126993
+ code: BORROW_CODES.HOST_FAILED,
126994
+ message: `\u300C${host}\u300D\u4EE3\u4E3A\u8C03\u7528\u6A21\u578B\u65F6\u5931\u8D25\uFF08${modelId}\uFF09${suffix}\u3002\u95EE\u9898\u51FA\u5728\u5BF9\u65B9\u7684 provider \u6216\u5176\u8D26\u53F7\u72B6\u6001\uFF0C\u4E0D\u662F\u4F60\u672C\u673A\u7684\u914D\u7F6E\u3002`
126995
+ };
126996
+ }
126997
+ function explainNotConnected(hostName, hostId) {
126998
+ const host = hostLabel(hostName, hostId);
126999
+ return {
127000
+ code: BORROW_CODES.NOT_CONNECTED,
127001
+ message: `\u4E0E\u300C${host}\u300D\u7684 Remote \u8FDE\u63A5\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u501F\u7528\u6A21\u578B\u3002\u8BF7\u786E\u8BA4\u5BF9\u65B9\u8BBE\u5907\u5728\u7EBF\u5E76\u5DF2\u767B\u5F55\u540C\u4E00 Remote \u8D26\u53F7\uFF1B\u8FDE\u63A5\u6062\u590D\u540E\u4F1A\u81EA\u52A8\u91CD\u8FDE\uFF0C\u4E5F\u53EF\u4EE5\u5230\u300C\u6A21\u578B\u5171\u4EAB \u2192 \u501F\u7528\u6A21\u578B\u300D\u5173\u6389\u518D\u6253\u5F00\u8BE5\u8BBE\u5907\u4EE5\u5F3A\u5236\u91CD\u8FDE\u3002`
127002
+ };
127003
+ }
127004
+ function explainTransportFailure(error62, hostName, hostId) {
127005
+ const host = hostLabel(hostName, hostId);
127006
+ const detail = error62 instanceof Error ? error62.message : typeof error62 === "string" ? error62 : "";
127007
+ const lower = detail.toLowerCase();
127008
+ if (lower.includes("cannot start after the remote client closed") || lower.includes("client closed")) {
127009
+ return explainNotConnected(hostName, hostId);
127010
+ }
127011
+ const suffix = detail === "" ? "" : `\uFF08${detail}\uFF09`;
127012
+ return {
127013
+ code: BORROW_CODES.TRANSPORT,
127014
+ message: `\u501F\u7528\u300C${host}\u300D\u7684\u6A21\u578B\u65F6\u8FDE\u63A5\u4E2D\u65AD${suffix}\u3002\u56DE\u590D\u53EF\u80FD\u5DF2\u88AB\u622A\u65AD\uFF1B\u91CD\u53D1\u8FD9\u6761\u6D88\u606F\u5373\u53EF\uFF0C\u63D2\u4EF6\u4F1A\u4E3A\u4E0B\u4E00\u6B21\u8BF7\u6C42\u91CD\u5EFA\u8FDE\u63A5\u3002`
127015
+ };
127016
+ }
127017
+ function explainModelGone(hostName, hostId, modelId) {
127018
+ const host = hostLabel(hostName, hostId);
127019
+ return {
127020
+ code: BORROW_CODES.MODEL_GONE,
127021
+ message: `\u300C${host}\u300D\u5DF2\u4E0D\u518D\u501F\u51FA\u6A21\u578B\u300C${modelId}\u300D\uFF0C\u672C\u673A\u76EE\u5F55\u6B63\u5728\u5237\u65B0\u3002\u8BF7\u7A0D\u7B49\u51E0\u79D2\u540E\u5728\u6A21\u578B\u9009\u62E9\u5668\u91CC\u91CD\u65B0\u9009\u4E00\u4E2A\u53EF\u7528\u6A21\u578B\u3002`
127022
+ };
127023
+ }
127024
+
126941
127025
  // packages/plugin/src/model-share/adapter.ts
126942
127026
  var streamCounter = 0;
126943
127027
  function nextStreamId() {
@@ -127018,7 +127102,8 @@ var RemoteModelAdapter = class extends LlmAdapter {
127018
127102
  const route = this.resolveRoute(options.model);
127019
127103
  if (route === void 0) {
127020
127104
  this.transport.onStale?.("model-missing");
127021
- yield failureChunk("NO_ADAPTER", `The lending Host no longer advertises model "${options.model}".`);
127105
+ const gone = explainModelGone(this.transport.hostName, this.transport.hostId, options.model);
127106
+ yield failureChunk(gone.code, gone.message);
127022
127107
  return;
127023
127108
  }
127024
127109
  const streamId = nextStreamId();
@@ -127035,10 +127120,8 @@ var RemoteModelAdapter = class extends LlmAdapter {
127035
127120
  });
127036
127121
  } catch (error62) {
127037
127122
  this.transport.onStale?.("model-missing");
127038
- yield failureChunk(
127039
- "NO_ADAPTER",
127040
- error62 instanceof Error ? `The lending Host rejected the request: ${error62.message}` : "The lending Host rejected the request."
127041
- );
127123
+ const failure4 = explainHostRejection(error62, this.transport.hostName, this.transport.hostId, route);
127124
+ yield failureChunk(failure4.code, failure4.message);
127042
127125
  return;
127043
127126
  }
127044
127127
  let aborted2 = false;
@@ -127061,13 +127144,31 @@ var RemoteModelAdapter = class extends LlmAdapter {
127061
127144
  batch = await this.transport.drain(streamId, 2e4);
127062
127145
  } catch (error62) {
127063
127146
  this.transport.onStale?.("connection-failed");
127064
- yield failureChunk(
127065
- "HTTP_502",
127066
- error62 instanceof Error ? `The lending Host connection failed: ${error62.message}` : "The lending Host connection failed."
127067
- );
127147
+ const failure4 = explainTransportFailure(error62, this.transport.hostName, this.transport.hostId);
127148
+ yield failureChunk(failure4.code, failure4.message);
127068
127149
  return;
127069
127150
  }
127070
- for (const chunk of batch.chunks) yield chunk;
127151
+ for (const chunk of batch.chunks) {
127152
+ if (chunk !== null && typeof chunk === "object" && chunk.type === "finish") {
127153
+ const reason = chunk.reason;
127154
+ if (reason?.kind === "error" && reason.failure !== void 0) {
127155
+ const host = this.transport.hostName.trim() === "" ? this.transport.hostId : this.transport.hostName;
127156
+ const original = reason.failure.message ?? "";
127157
+ yield {
127158
+ type: "finish",
127159
+ reason: {
127160
+ kind: "error",
127161
+ failure: {
127162
+ code: BORROW_CODES.HOST_FAILED,
127163
+ message: `\u300C${host}\u300D\u4EE3\u4E3A\u8C03\u7528\u6A21\u578B\u65F6\u5931\u8D25\uFF1A${original === "" ? "\u5BF9\u65B9\u672A\u63D0\u4F9B\u5177\u4F53\u539F\u56E0" : original}`
127164
+ }
127165
+ }
127166
+ };
127167
+ continue;
127168
+ }
127169
+ }
127170
+ yield chunk;
127171
+ }
127071
127172
  if (batch.finished !== void 0) {
127072
127173
  if (batch.finished.reason === "error") {
127073
127174
  this.logger?.warn("model-share: borrower stream failed on the Host", {
@@ -127171,8 +127272,19 @@ var BorrowerRuntime = class {
127171
127272
  }
127172
127273
  const existing = this.registered.get(hostId);
127173
127274
  if (existing !== void 0) {
127275
+ const changed = existing.holder.models.length !== selected.length || selected.some((entry, index) => existing.holder.models[index]?.id !== entry.id);
127174
127276
  existing.holder.models = [...selected];
127175
127277
  existing.models = existing.holder.models;
127278
+ if (changed) {
127279
+ try {
127280
+ existing.handle.replace([providerId]);
127281
+ } catch (error62) {
127282
+ this.logger?.warn("model-share: catalog republish failed", {
127283
+ hostId,
127284
+ reason: error62 instanceof Error ? error62.message : "unknown"
127285
+ });
127286
+ }
127287
+ }
127176
127288
  if (existing.transport !== transport) {
127177
127289
  if (existing.transport?.release !== transport.release) {
127178
127290
  try {
@@ -128753,7 +128865,7 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128753
128865
  const SYNC_RETRY_MS = 15e3;
128754
128866
  const lastSyncAt = /* @__PURE__ */ new Map();
128755
128867
  const lastSyncOk = /* @__PURE__ */ new Map();
128756
- const syncBorrowed = async () => {
128868
+ const syncBorrowed = async (force = false) => {
128757
128869
  if (closed) return;
128758
128870
  const { borrower: policy } = await activeStore.read();
128759
128871
  for (const hostId of borrower.activeHosts()) {
@@ -128767,7 +128879,7 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128767
128879
  for (const [hostId, source] of Object.entries(policy.sources)) {
128768
128880
  if (!source.enabled) continue;
128769
128881
  const elapsed = now - (lastSyncAt.get(hostId) ?? 0);
128770
- if (elapsed < (lastSyncOk.get(hostId) === false ? SYNC_RETRY_MS : SYNC_OK_MS)) continue;
128882
+ if (!force && elapsed < (lastSyncOk.get(hostId) === false ? SYNC_RETRY_MS : SYNC_OK_MS)) continue;
128771
128883
  lastSyncAt.set(hostId, now);
128772
128884
  const deviceName = source.hostName ?? hostId;
128773
128885
  let transport = syncTransports.get(hostId);
@@ -128792,9 +128904,9 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128792
128904
  }
128793
128905
  };
128794
128906
  void syncBorrowed();
128795
- borrowerSync = syncBorrowed;
128907
+ borrowerSync = () => syncBorrowed(true);
128796
128908
  activeStore.watch(() => {
128797
- void syncBorrowed();
128909
+ void syncBorrowed(true);
128798
128910
  });
128799
128911
  const syncTimer = setInterval(() => {
128800
128912
  void syncBorrowed();
@@ -128811,9 +128923,7 @@ async function activate(ctx, readConfig, entryId, requireRemoteEvents = false) {
128811
128923
  borrowerSyncOnStale = (hostId) => {
128812
128924
  if (staleHosts.has(hostId)) return;
128813
128925
  staleHosts.add(hostId);
128814
- lastSyncAt.set(hostId, 0);
128815
- lastSyncOk.set(hostId, false);
128816
- void syncBorrowed().finally(() => staleHosts.delete(hostId));
128926
+ void syncBorrowed(true).finally(() => staleHosts.delete(hostId));
128817
128927
  };
128818
128928
  }
128819
128929
  return { runtime: nextRuntime, clientRuntime: nextClientRuntime };
package/dsh-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
3
  "id": "com.r2049.ds-harness-remote",
4
4
  "name": "@musdrop/ds-harness-remote",
5
- "version": "0.6.20",
5
+ "version": "0.6.22",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musdrop/ds-harness-remote",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
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",