dsh-deeppilot 0.8.3 → 0.9.1
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/COMPATIBILITY.md +81 -4
- package/README.md +30 -19
- package/README.zh-CN.md +21 -14
- package/docs/DSH_RELEASE_MEMORY.md +239 -1
- package/lib/client.js +71 -3
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +15 -4
- package/lib/index.js +40 -15
- package/lib/index.js.map +1 -1
- package/package.json +17 -16
package/lib/client.js
CHANGED
|
@@ -263,7 +263,6 @@ window.__ModuleLoader__.load({
|
|
|
263
263
|
pairingReady: bool(s, "pairingReady", "pairingReady"),
|
|
264
264
|
activeConnections: int(s, "activeConnections", "activeConnections"),
|
|
265
265
|
historyBufferMax: int(s, "historyBufferMax", "historyBufferMax"),
|
|
266
|
-
debug: bool(s, "debug", "debug"),
|
|
267
266
|
lanAddresses,
|
|
268
267
|
local: parseLocal(s.local),
|
|
269
268
|
remote: parseRemote(s.remote),
|
|
@@ -457,6 +456,8 @@ window.__ModuleLoader__.load({
|
|
|
457
456
|
"troubleshooting.summary": "测试与故障排查",
|
|
458
457
|
"troubleshooting.title": "诊断工具",
|
|
459
458
|
"troubleshooting.description": "仅在排查连接或推送问题时使用。",
|
|
459
|
+
"troubleshooting.debugTitle": "调试日志",
|
|
460
|
+
"troubleshooting.debugDescription": "打开后在 DSH host 的终端输出里打印握手、推送等诊断信息;不会打印配对令牌、APNs token 或消息内容。改动立即生效,无需重启。",
|
|
460
461
|
"system.summary": "系统信息",
|
|
461
462
|
"system.title": "运行信息",
|
|
462
463
|
"system.description": "插件、协议与连接端点的技术信息。",
|
|
@@ -630,6 +631,7 @@ window.__ModuleLoader__.load({
|
|
|
630
631
|
"diag.missingLocalPortHook": "useDeepPilotLocalPort hook 缺失",
|
|
631
632
|
"diag.missingRemoteEnabledHook": "useDeepPilotRemoteEnabled hook 缺失",
|
|
632
633
|
"diag.missingRemoteLimitHook": "useDeepPilotRemoteConnectionLimit hook 缺失",
|
|
634
|
+
"diag.missingDebugHook": "useDeepPilotDebug hook 缺失",
|
|
633
635
|
"diag.missingRefresh": "refresh 回调缺失",
|
|
634
636
|
"diag.missingReveal": "beginPairing 回调缺失",
|
|
635
637
|
"diag.missingRotate": "revokeDevice 回调缺失",
|
|
@@ -641,6 +643,7 @@ window.__ModuleLoader__.load({
|
|
|
641
643
|
"diag.missingSetLocalPort": "setDeepPilotLocalPort 回调缺失",
|
|
642
644
|
"diag.missingSetRemote": "setDeepPilotRemoteEnabled 回调缺失",
|
|
643
645
|
"diag.missingSetRemoteLimit": "setDeepPilotRemoteConnectionLimit 回调缺失",
|
|
646
|
+
"diag.missingSetDebug": "setDeepPilotDebug 回调缺失",
|
|
644
647
|
"diag.renderError": "渲染异常: ",
|
|
645
648
|
"diag.prefix": "diag: ",
|
|
646
649
|
"clipboard.rejected": "浏览器拒绝了剪贴板写入",
|
|
@@ -671,6 +674,8 @@ window.__ModuleLoader__.load({
|
|
|
671
674
|
"troubleshooting.summary": "Tests and troubleshooting",
|
|
672
675
|
"troubleshooting.title": "Diagnostic tools",
|
|
673
676
|
"troubleshooting.description": "Use these only when diagnosing connection or push issues.",
|
|
677
|
+
"troubleshooting.debugTitle": "Debug logging",
|
|
678
|
+
"troubleshooting.debugDescription": "When on, prints handshake and push diagnostics to the DSH host’s terminal output; never prints pairing tokens, APNs tokens, or message content. Takes effect immediately, no restart needed.",
|
|
674
679
|
"system.summary": "System information",
|
|
675
680
|
"system.title": "Runtime information",
|
|
676
681
|
"system.description": "Technical details about the plugin, protocol, and endpoints.",
|
|
@@ -844,6 +849,7 @@ window.__ModuleLoader__.load({
|
|
|
844
849
|
"diag.missingLocalPortHook": "useDeepPilotLocalPort hook missing",
|
|
845
850
|
"diag.missingRemoteEnabledHook": "useDeepPilotRemoteEnabled hook missing",
|
|
846
851
|
"diag.missingRemoteLimitHook": "useDeepPilotRemoteConnectionLimit hook missing",
|
|
852
|
+
"diag.missingDebugHook": "useDeepPilotDebug hook missing",
|
|
847
853
|
"diag.missingRefresh": "refresh callback missing",
|
|
848
854
|
"diag.missingReveal": "beginPairing callback missing",
|
|
849
855
|
"diag.missingRotate": "revokeDevice callback missing",
|
|
@@ -855,6 +861,7 @@ window.__ModuleLoader__.load({
|
|
|
855
861
|
"diag.missingSetLocalPort": "setDeepPilotLocalPort callback missing",
|
|
856
862
|
"diag.missingSetRemote": "setDeepPilotRemoteEnabled callback missing",
|
|
857
863
|
"diag.missingSetRemoteLimit": "setDeepPilotRemoteConnectionLimit callback missing",
|
|
864
|
+
"diag.missingSetDebug": "setDeepPilotDebug callback missing",
|
|
858
865
|
"diag.renderError": "Render error: ",
|
|
859
866
|
"diag.prefix": "diag: ",
|
|
860
867
|
"clipboard.rejected": "Clipboard write rejected by the browser",
|
|
@@ -3869,6 +3876,8 @@ window.__ModuleLoader__.load({
|
|
|
3869
3876
|
let remoteSwitchReady = false;
|
|
3870
3877
|
let remoteConnectionLimit = 8;
|
|
3871
3878
|
let remoteConnectionLimitReady = false;
|
|
3879
|
+
let debugEnabled = false;
|
|
3880
|
+
let debugSwitchReady = false;
|
|
3872
3881
|
let failed = false;
|
|
3873
3882
|
try {
|
|
3874
3883
|
if (typeof props.useDeepPilotReport !== "function") {
|
|
@@ -3919,6 +3928,12 @@ window.__ModuleLoader__.load({
|
|
|
3919
3928
|
remoteConnectionLimitReady = state.status === "ready";
|
|
3920
3929
|
} else diag.push(translateWith(props.t, "diag.missingRemoteLimitHook"));
|
|
3921
3930
|
if (typeof props.setDeepPilotRemoteConnectionLimit !== "function") diag.push(translateWith(props.t, "diag.missingSetRemoteLimit"));
|
|
3931
|
+
if (typeof props.useDeepPilotDebug === "function") {
|
|
3932
|
+
const state = props.useDeepPilotDebug((s) => s);
|
|
3933
|
+
debugEnabled = state.enabled;
|
|
3934
|
+
debugSwitchReady = state.status === "ready";
|
|
3935
|
+
} else diag.push(translateWith(props.t, "diag.missingDebugHook"));
|
|
3936
|
+
if (typeof props.setDeepPilotDebug !== "function") diag.push(translateWith(props.t, "diag.missingSetDebug"));
|
|
3922
3937
|
} catch (error) {
|
|
3923
3938
|
diag.push(translateWith(props.t, "diag.renderError") + (error instanceof Error ? error.message : String(error)));
|
|
3924
3939
|
failed = true;
|
|
@@ -4321,7 +4336,17 @@ window.__ModuleLoader__.load({
|
|
|
4321
4336
|
className: "pbb-action",
|
|
4322
4337
|
disabled: pushTestBusy,
|
|
4323
4338
|
onClick: sendPushTest
|
|
4324
|
-
}, pushTestBusy ? translateWith(props.t, "push.pushSending") : translateWith(props.t, "push.testPush")))
|
|
4339
|
+
}, pushTestBusy ? translateWith(props.t, "push.pushSending") : translateWith(props.t, "push.testPush"))), (0, react.createElement)("div", { className: "pbb-testItem" }, (0, react.createElement)("div", { className: "pbb-switchText" }, (0, react.createElement)("span", { className: "pbb-testTitle" }, translateWith(props.t, "troubleshooting.debugTitle")), (0, react.createElement)("span", { className: "pbb-testDescription" }, translateWith(props.t, "troubleshooting.debugDescription"))), (0, react.createElement)("button", {
|
|
4340
|
+
type: "button",
|
|
4341
|
+
role: "switch",
|
|
4342
|
+
"aria-checked": debugEnabled,
|
|
4343
|
+
"aria-label": translateWith(props.t, "troubleshooting.debugTitle"),
|
|
4344
|
+
disabled: !debugSwitchReady,
|
|
4345
|
+
className: "pbb-switch" + (debugEnabled ? " pbb-switchOn" : ""),
|
|
4346
|
+
onClick: () => {
|
|
4347
|
+
if (typeof props.setDeepPilotDebug === "function") props.setDeepPilotDebug(!debugEnabled);
|
|
4348
|
+
}
|
|
4349
|
+
}))), relayTestError ? (0, react.createElement)("p", { className: "pbb-diag pbb-diagBad" }, relayTestError) : null, relayTestResult === null ? (0, react.createElement)("p", { className: "pbb-diag" }, translateWith(props.t, "push.relayDefault")) : (0, react.createElement)("div", { className: "pbb-helpBody" }, (0, react.createElement)("div", { className: "pbb-row" }, (0, react.createElement)("span", { className: "pbb-label" }, relayTestResult.url || translateWith(props.t, "push.relayUrlEmpty")), (0, react.createElement)("code", { className: "pbb-token " + (relayTestResult.overall === "ok" ? "pbb-ok" : "pbb-bad") }, relayTestResult.overall === "ok" ? translateWith(props.t, "push.relayOk") : translateWith(props.t, "push.relayBad"))), relayTestResult.steps.map((step, index) => (0, react.createElement)("p", {
|
|
4325
4350
|
className: "pbb-diag",
|
|
4326
4351
|
key: String(index)
|
|
4327
4352
|
}, (step.ok ? "✓ " : "✗ ") + (step.id === "health" ? translateWith(props.t, "push.relayStep.health") : translateWith(props.t, "push.relayStep.enroll")) + (step.latencyMs !== void 0 ? ` (${String(step.latencyMs)}ms)` : "") + " — " + step.message))), pushTestError ? (0, react.createElement)("p", { className: "pbb-diag pbb-diagBad" }, pushTestError) : null, pushTestResult === null ? (0, react.createElement)("p", { className: "pbb-diag" }, translateWith(props.t, "push.pushDefault")) : (0, react.createElement)("div", { className: "pbb-helpBody" }, (0, react.createElement)("div", { className: "pbb-row" }, (0, react.createElement)("code", { className: "pbb-token " + (pushTestResult.overall === "sent" ? "pbb-ok" : pushTestResult.overall === "failed" ? "pbb-bad" : "") }, pushTestResult.overall === "sent" ? translateWith(props.t, "push.pushSent") : pushTestResult.overall === "failed" ? translateWith(props.t, "push.pushFailed") : pushTestResult.overall === "no-targets" ? translateWith(props.t, "push.pushNoTargets") : translateWith(props.t, "push.pushNotEnabled"))), pushTestResult.message ? (0, react.createElement)("p", { className: "pbb-diag" }, pushTestResult.message) : null, pushTestResult.results.map((r, index) => (0, react.createElement)("p", {
|
|
@@ -4671,6 +4696,47 @@ window.__ModuleLoader__.load({
|
|
|
4671
4696
|
throw error;
|
|
4672
4697
|
}
|
|
4673
4698
|
};
|
|
4699
|
+
const debugStore = createSnapshotStore({
|
|
4700
|
+
status: "loading",
|
|
4701
|
+
enabled: false
|
|
4702
|
+
});
|
|
4703
|
+
const adoptDebug = () => {
|
|
4704
|
+
if (scope === void 0) return;
|
|
4705
|
+
const snap = scope.getSnapshot();
|
|
4706
|
+
if (snap.status === "ready") debugStore.set({
|
|
4707
|
+
status: "ready",
|
|
4708
|
+
enabled: snap.value?.diagnostics?.debug === true
|
|
4709
|
+
});
|
|
4710
|
+
else if (snap.status === "unavailable") debugStore.set({
|
|
4711
|
+
status: "unavailable",
|
|
4712
|
+
enabled: false
|
|
4713
|
+
});
|
|
4714
|
+
};
|
|
4715
|
+
scopeAdoptions.push(adoptDebug);
|
|
4716
|
+
const lastConfirmedDebug = () => {
|
|
4717
|
+
const snap = scope?.getSnapshot();
|
|
4718
|
+
if (snap?.status === "ready") return snap.value?.diagnostics?.debug === true;
|
|
4719
|
+
return debugStore.getSnapshot().enabled;
|
|
4720
|
+
};
|
|
4721
|
+
const setDeepPilotDebug = (value) => {
|
|
4722
|
+
const previous = lastConfirmedDebug();
|
|
4723
|
+
debugStore.set({
|
|
4724
|
+
status: "ready",
|
|
4725
|
+
enabled: value
|
|
4726
|
+
});
|
|
4727
|
+
if (scope === void 0) return;
|
|
4728
|
+
const currentDiagnostics = scope.getSnapshot().value?.diagnostics ?? {};
|
|
4729
|
+
scope.set("diagnostics", {
|
|
4730
|
+
...currentDiagnostics,
|
|
4731
|
+
debug: value
|
|
4732
|
+
}).then(() => {}, (error) => {
|
|
4733
|
+
debugStore.set({
|
|
4734
|
+
status: "ready",
|
|
4735
|
+
enabled: previous
|
|
4736
|
+
});
|
|
4737
|
+
console.error("[deeppilot] failed to persist diagnostics.debug=" + String(value) + ": " + (error instanceof Error ? error.message : String(error)));
|
|
4738
|
+
});
|
|
4739
|
+
};
|
|
4674
4740
|
const remoteEnabledStore = createSnapshotStore({
|
|
4675
4741
|
status: "loading",
|
|
4676
4742
|
enabled: false
|
|
@@ -4783,7 +4849,8 @@ window.__ModuleLoader__.load({
|
|
|
4783
4849
|
deepPilotLocalEnabled: localEnabledStore,
|
|
4784
4850
|
deepPilotLocalPort: localPortStore,
|
|
4785
4851
|
deepPilotRemoteEnabled: remoteEnabledStore,
|
|
4786
|
-
deepPilotRemoteConnectionLimit: remoteConnectionLimitStore
|
|
4852
|
+
deepPilotRemoteConnectionLimit: remoteConnectionLimitStore,
|
|
4853
|
+
deepPilotDebug: debugStore
|
|
4787
4854
|
},
|
|
4788
4855
|
refresh: () => {
|
|
4789
4856
|
controller.refresh();
|
|
@@ -4798,6 +4865,7 @@ window.__ModuleLoader__.load({
|
|
|
4798
4865
|
setDeepPilotLocalPort,
|
|
4799
4866
|
setDeepPilotRemoteEnabled,
|
|
4800
4867
|
setDeepPilotRemoteConnectionLimit,
|
|
4868
|
+
setDeepPilotDebug,
|
|
4801
4869
|
t: (key, vars) => t(ctx, key, vars)
|
|
4802
4870
|
})
|
|
4803
4871
|
}, DeepPilotSettingsPage));
|