@dsh-remote/relay 3.2.1 → 3.2.4
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/bundle/main.js +26 -12
- package/package.json +1 -1
package/dist/bundle/main.js
CHANGED
|
@@ -23443,7 +23443,7 @@ function date4(params) {
|
|
|
23443
23443
|
return _coercedDate(ZodDate, params);
|
|
23444
23444
|
}
|
|
23445
23445
|
|
|
23446
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
23446
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/limits.js
|
|
23447
23447
|
var MAX_RELAY_MESSAGE_BYTES = 1024 * 1024;
|
|
23448
23448
|
var MAX_CIPHERTEXT_BYTES = MAX_RELAY_MESSAGE_BYTES - 8 * 1024;
|
|
23449
23449
|
var MAX_IMAGE_ATTACHMENTS = 4;
|
|
@@ -23452,7 +23452,7 @@ var MAX_ATTACHMENT_BYTES = 512 * 1024;
|
|
|
23452
23452
|
var MAX_ATTACHMENT_TOTAL_BYTES = 512 * 1024;
|
|
23453
23453
|
var IDEMPOTENCY_WINDOW_MS = 5 * 60 * 1e3;
|
|
23454
23454
|
|
|
23455
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
23455
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/frames.js
|
|
23456
23456
|
var PROTOCOL_VERSION = 1;
|
|
23457
23457
|
var PAIRING_TOKEN_RE = /^\d{6}$/;
|
|
23458
23458
|
var nonEmpty = external_exports.string().min(1);
|
|
@@ -23965,7 +23965,7 @@ var import_subprotocol = __toESM(require_subprotocol(), 1);
|
|
|
23965
23965
|
var import_websocket = __toESM(require_websocket(), 1);
|
|
23966
23966
|
var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
23967
23967
|
|
|
23968
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
23968
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/identity/ids.js
|
|
23969
23969
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
23970
23970
|
var CONVERSATION_ID_PREFIX = "c_";
|
|
23971
23971
|
function newConversationId() {
|
|
@@ -23975,7 +23975,7 @@ function newHostId() {
|
|
|
23975
23975
|
return randomBytes(4).toString("hex");
|
|
23976
23976
|
}
|
|
23977
23977
|
|
|
23978
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
23978
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/negotiate.js
|
|
23979
23979
|
function negotiateProtocol(peerProtocol, own2 = PROTOCOL_VERSION) {
|
|
23980
23980
|
if (peerProtocol === void 0 || peerProtocol === null) {
|
|
23981
23981
|
return {
|
|
@@ -24095,16 +24095,16 @@ function createMpCodeIssuer(options) {
|
|
|
24095
24095
|
};
|
|
24096
24096
|
}
|
|
24097
24097
|
|
|
24098
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24098
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/errors.js
|
|
24099
24099
|
var WAIT_HINTABLE = /* @__PURE__ */ new Set(["rate_limited", "pair_table_full"]);
|
|
24100
24100
|
function wantsRetryAfter(code) {
|
|
24101
24101
|
return typeof code === "string" && WAIT_HINTABLE.has(code);
|
|
24102
24102
|
}
|
|
24103
24103
|
|
|
24104
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24104
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/platform/sleep.js
|
|
24105
24105
|
var SLEEP_BACKENDS = ["caffeinate", "systemd-inhibit", "unsupported"];
|
|
24106
24106
|
|
|
24107
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24107
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/payloads.js
|
|
24108
24108
|
var SESSION_STATES = [
|
|
24109
24109
|
"idle",
|
|
24110
24110
|
"running",
|
|
@@ -24289,7 +24289,21 @@ var evHostInfo = external_exports.object({
|
|
|
24289
24289
|
profile: external_exports.string().optional(),
|
|
24290
24290
|
/** 内核载体名(`services` / `mock` / …)——手机上报"看不到工具行"时,这一格先看它。 */
|
|
24291
24291
|
carrier: external_exports.string().optional(),
|
|
24292
|
-
dshVersion: external_exports.string().optional()
|
|
24292
|
+
dshVersion: external_exports.string().optional(),
|
|
24293
|
+
/**
|
|
24294
|
+
* **宿主插件自己的**版本(`@dsh-remote/plugin`),不是内核版本(那是 `dshVersion`)。
|
|
24295
|
+
*
|
|
24296
|
+
* 2026-10-21 加:手机要在首页告诉用户"电脑上的插件太旧了,请升级到 X"。
|
|
24297
|
+
* 这条提示的必要性来自当天那次事故 —— 3.2 改了配对协议(码里只有 6 位配对码,
|
|
24298
|
+
* psk 由主机用 X25519 加密送回),**3.1.x 的插件配不上 3.2.x 的小程序**;
|
|
24299
|
+
* 而 pnpm 的 `minimumReleaseAge` 会把插件静默降级到最后一个"够老"的版本,
|
|
24300
|
+
* 用户看到的正是"扫了码什么都没发生",**两端都不报错**。
|
|
24301
|
+
*
|
|
24302
|
+
* ⚠️ **必须是 optional**:3.2.0 之前的插件不发这一格,而手机连的主机里
|
|
24303
|
+
* 恰恰就有那一批。必填会让整帧 `ev.host_info` 被 schema 拒掉 ——
|
|
24304
|
+
* 那比"少一个字段"糟得多(限额、防休眠状态全跟着丢)。
|
|
24305
|
+
*/
|
|
24306
|
+
pluginVersion: external_exports.string().optional()
|
|
24293
24307
|
}),
|
|
24294
24308
|
limits: hostLimits,
|
|
24295
24309
|
state: external_exports.object({
|
|
@@ -24530,7 +24544,7 @@ var PAYLOAD_TYPES = {
|
|
|
24530
24544
|
evSessionHistory: "ev.session_history"
|
|
24531
24545
|
};
|
|
24532
24546
|
|
|
24533
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24547
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/outbound.js
|
|
24534
24548
|
function helloOkForClient(clientId, protocol) {
|
|
24535
24549
|
return { t: "hello-ok", role: "client", clientId, ...protocol === void 0 ? {} : { protocol } };
|
|
24536
24550
|
}
|
|
@@ -24617,7 +24631,7 @@ function encBatchToRelay(sessionId, items) {
|
|
|
24617
24631
|
return { t: "enc-batch", sessionId, items: items.map((item) => ({ ...item })) };
|
|
24618
24632
|
}
|
|
24619
24633
|
|
|
24620
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24634
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/registry.js
|
|
24621
24635
|
var ENDPOINT_FRAME_NAMES = [
|
|
24622
24636
|
"hello",
|
|
24623
24637
|
"pair-begin",
|
|
@@ -24682,7 +24696,7 @@ var EV_TYPES = [
|
|
|
24682
24696
|
];
|
|
24683
24697
|
var PAYLOAD_TYPE_SET = /* @__PURE__ */ new Set([...CMD_TYPES, ...EV_TYPES]);
|
|
24684
24698
|
|
|
24685
|
-
// node_modules/.pnpm/@dsh-remote+protocol@3.2.
|
|
24699
|
+
// node_modules/.pnpm/@dsh-remote+protocol@3.2.4/node_modules/@dsh-remote/protocol/dist/src/wire/classify.js
|
|
24686
24700
|
function frameTypeOf(value) {
|
|
24687
24701
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
24688
24702
|
return void 0;
|
|
@@ -26450,7 +26464,7 @@ function registerSignalHandlers(shutdown) {
|
|
|
26450
26464
|
|
|
26451
26465
|
// src/main.ts
|
|
26452
26466
|
function readVersion() {
|
|
26453
|
-
if ("3.2.
|
|
26467
|
+
if ("3.2.4") return "3.2.4";
|
|
26454
26468
|
try {
|
|
26455
26469
|
const pkg = JSON.parse(readFileSync2(new URL("../../package.json", import.meta.url), "utf8"));
|
|
26456
26470
|
if (typeof pkg.version === "string") return pkg.version;
|