dsh-remote-local-plugin 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/goldenpigeon-dsh-remote-agent-0.2.3.tgz +0 -0
- package/lib/client.js +35 -12
- package/lib/client.js.map +2 -2
- package/lib/index.js +613 -42
- package/lib/types/host-api/contract.d.ts +5 -1
- package/lib/types/mirror/service.d.ts +10 -2
- package/lib/types/remote/restart.d.ts +7 -0
- package/lib/types/rpc/contract.d.ts +114 -0
- package/lib/types/rpc/handler.d.ts +12 -0
- package/lib/types/service.d.ts +13 -1
- package/node_modules/dsh-remote-terminal-controller/lib/client.js.map +7 -0
- package/package.json +1 -1
- package/assets/dsh-remote-agent-0.2.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Remote development that appears as ordinary local sessions.
|
|
|
7
7
|
This plugin targets the official **DSH Desktop** application. Tested/supported versions:
|
|
8
8
|
|
|
9
9
|
- [DSH Desktop](https://github.com/deepseek-ai/deepseek-harness) [`0.2.1-rc.2`](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.2)
|
|
10
|
-
- Plugin [`0.8.
|
|
10
|
+
- Plugin [`0.8.5`](https://www.npmjs.com/package/dsh-remote-local-plugin)
|
|
11
11
|
- Remote DSH [`0.2.1-rc.2`](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.2)
|
|
12
12
|
- Remote [Node.js `22.19+`](https://nodejs.org/en/download) on Linux/macOS
|
|
13
13
|
|
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -56,6 +56,7 @@ function createHostsApi(ctx) {
|
|
|
56
56
|
disconnect: (hostId) => call("host/disconnect", { hostId }),
|
|
57
57
|
refresh: (hostId) => call("host/refresh", { hostId }),
|
|
58
58
|
provision: (hostId) => call("host/provision", { hostId }),
|
|
59
|
+
restart: (hostId) => call("host/restart", { hostId }),
|
|
59
60
|
workspaces: (hostId) => call("host/workspaces", { hostId }),
|
|
60
61
|
listDirectories: (hostId, path) => call("host/directory/list", { hostId, ...path === void 0 ? {} : { path } }),
|
|
61
62
|
listLocalDirectories: (path) => call("local/directory/list", { ...path === void 0 ? {} : { path } }),
|
|
@@ -75,20 +76,20 @@ function createHostsApi(ctx) {
|
|
|
75
76
|
openSession: (sessionId) => {
|
|
76
77
|
ctx.uiWorkspace.openSession(sessionId);
|
|
77
78
|
},
|
|
78
|
-
fileList: (sessionId, path) => call("host/files/list", { sessionId, path }),
|
|
79
|
-
fileRead: (sessionId, path, offset, limit) => call("host/files/read", {
|
|
79
|
+
fileList: (sessionId, path, signal) => call("host/files/list", { sessionId, path }, signal),
|
|
80
|
+
fileRead: (sessionId, path, offset, limit, signal) => call("host/files/read", {
|
|
80
81
|
sessionId,
|
|
81
82
|
path,
|
|
82
83
|
...offset === void 0 ? {} : { offset },
|
|
83
84
|
...limit === void 0 ? {} : { limit }
|
|
84
|
-
}),
|
|
85
|
-
fileStat: (sessionId, path) => call("host/files/stat", { sessionId, path }),
|
|
86
|
-
fileBytes: (sessionId, path, offset, length) => call("host/files/bytes", {
|
|
85
|
+
}, signal),
|
|
86
|
+
fileStat: (sessionId, path, signal) => call("host/files/stat", { sessionId, path }, signal),
|
|
87
|
+
fileBytes: (sessionId, path, offset, length, signal) => call("host/files/bytes", {
|
|
87
88
|
sessionId,
|
|
88
89
|
path,
|
|
89
90
|
...offset === void 0 ? {} : { offset },
|
|
90
91
|
...length === void 0 ? {} : { length }
|
|
91
|
-
}),
|
|
92
|
+
}, signal),
|
|
92
93
|
prompt: (hostId, sessionId, text, mode, selection) => call("host/session/prompt", {
|
|
93
94
|
hostId,
|
|
94
95
|
sessionId,
|
|
@@ -99,12 +100,13 @@ function createHostsApi(ctx) {
|
|
|
99
100
|
cancel: (hostId, sessionId) => call("host/session/cancel", { hostId, sessionId })
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
|
-
async function call(endpoint, payload) {
|
|
103
|
+
async function call(endpoint, payload, signal) {
|
|
103
104
|
const response = await fetch(HOST_API_PATH, {
|
|
104
105
|
method: "POST",
|
|
105
106
|
credentials: "same-origin",
|
|
106
107
|
headers: { "content-type": "application/json" },
|
|
107
|
-
body: JSON.stringify(payload === void 0 ? { endpoint } : { endpoint, payload })
|
|
108
|
+
body: JSON.stringify(payload === void 0 ? { endpoint } : { endpoint, payload }),
|
|
109
|
+
...signal === void 0 ? {} : { signal }
|
|
108
110
|
});
|
|
109
111
|
if (!response.ok) {
|
|
110
112
|
throw new RemoteUiError("request/invalid", `host API returned HTTP ${response.status}`);
|
|
@@ -132,6 +134,7 @@ var DETAIL_KEYS = {
|
|
|
132
134
|
"\u6B63\u5728\u8FDC\u7AEF\u5B89\u88C5 DSH \u4E0E dsh-remote-agent\uFF0C\u9996\u6B21\u7EA6 1\u20133 \u5206\u949F\u2026": "detail.installing",
|
|
133
135
|
"\u6B63\u5728\u5EFA\u7ACB SSH \u96A7\u9053\u5E76\u6821\u9A8C\u8FDC\u7AEF agent\u2026": "detail.connecting",
|
|
134
136
|
"\u6B63\u5728\u91CD\u65B0\u5B89\u88C5\u8FDC\u7AEF agent\u2026": "detail.reprovisioning",
|
|
137
|
+
"\u6B63\u5728\u91CD\u542F\u8FDC\u7AEF DSH\u2026": "detail.restarting",
|
|
135
138
|
"SSH \u96A7\u9053\u65AD\u5F00\uFF0C\u7B49\u5F85\u91CD\u8FDE\u2026": "detail.reconnecting",
|
|
136
139
|
"\u6B63\u5728\u51C6\u5907\u8FDC\u7AEF\u5B89\u88C5\u73AF\u5883\u2026": "detail.preparing",
|
|
137
140
|
"\u6B63\u5728\u914D\u7F6E\u8FDC\u7AEF\u5B89\u88C5\u4EE3\u7406\u2026": "detail.proxyPreparing",
|
|
@@ -517,6 +520,20 @@ function RemoteDevelopmentPanel({ api, t }) {
|
|
|
517
520
|
}
|
|
518
521
|
)
|
|
519
522
|
] }),
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
524
|
+
"button",
|
|
525
|
+
{
|
|
526
|
+
type: "button",
|
|
527
|
+
className: "dshr-button",
|
|
528
|
+
disabled: busy !== null || host.phase === "installing",
|
|
529
|
+
onClick: () => {
|
|
530
|
+
void run(`restart:${host.id}`, async () => {
|
|
531
|
+
await api.restart(host.id);
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
children: busy === `restart:${host.id}` ? t("settings.restarting") : t("settings.restart")
|
|
535
|
+
}
|
|
536
|
+
),
|
|
520
537
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
521
538
|
"button",
|
|
522
539
|
{
|
|
@@ -690,19 +707,19 @@ function installRemoteFiles(ctx, api) {
|
|
|
690
707
|
readBytes: face.readBytes.bind(face)
|
|
691
708
|
};
|
|
692
709
|
face.list = async (sessionId, path, signal) => {
|
|
693
|
-
const result = await api.fileList(sessionId, path);
|
|
710
|
+
const result = await api.fileList(sessionId, path, signal);
|
|
694
711
|
return result.mirrored ? { ok: true, value: result.value } : original.list(sessionId, path, signal);
|
|
695
712
|
};
|
|
696
713
|
face.read = async (sessionId, path, range, signal) => {
|
|
697
|
-
const result = await api.fileRead(sessionId, path, range.offset, range.limit);
|
|
714
|
+
const result = await api.fileRead(sessionId, path, range.offset, range.limit, signal);
|
|
698
715
|
return result.mirrored ? { ok: true, value: result.value } : original.read(sessionId, path, range, signal);
|
|
699
716
|
};
|
|
700
717
|
face.stat = async (sessionId, path, signal) => {
|
|
701
|
-
const result = await api.fileStat(sessionId, path);
|
|
718
|
+
const result = await api.fileStat(sessionId, path, signal);
|
|
702
719
|
return result.mirrored ? { ok: true, value: result.value } : original.stat(sessionId, path, signal);
|
|
703
720
|
};
|
|
704
721
|
face.readBytes = async (sessionId, path, options, signal) => {
|
|
705
|
-
const result = await api.fileBytes(sessionId, path, options.range?.offset, options.range?.length);
|
|
722
|
+
const result = await api.fileBytes(sessionId, path, options.range?.offset, options.range?.length, signal);
|
|
706
723
|
return result.mirrored ? { ok: true, value: result.value } : original.readBytes(sessionId, path, options, signal);
|
|
707
724
|
};
|
|
708
725
|
}
|
|
@@ -756,6 +773,8 @@ var zh = {
|
|
|
756
773
|
"settings.connect": "\u8FDE\u63A5",
|
|
757
774
|
"settings.installing": "\u6B63\u5728\u5B89\u88C5\u2026",
|
|
758
775
|
"settings.connecting": "\u6B63\u5728\u8FDE\u63A5\u2026",
|
|
776
|
+
"settings.restart": "\u91CD\u542F\u8FDC\u7AEF DSH",
|
|
777
|
+
"settings.restarting": "\u91CD\u542F\u4E2D\u2026",
|
|
759
778
|
"settings.reprovision": "\u91CD\u65B0\u5B89\u88C5",
|
|
760
779
|
"settings.remove": "\u5220\u9664",
|
|
761
780
|
"settings.workspacePathPlaceholder": "\u8FDC\u7AEF\u76EE\u5F55\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4F8B\u5982 /home/user/project",
|
|
@@ -780,6 +799,7 @@ var zh = {
|
|
|
780
799
|
"detail.installing": "\u6B63\u5728\u8FDC\u7AEF\u5B89\u88C5 DSH \u4E0E dsh-remote-agent\uFF0C\u9996\u6B21\u7EA6 1\u20133 \u5206\u949F\u2026",
|
|
781
800
|
"detail.connecting": "\u6B63\u5728\u5EFA\u7ACB SSH \u96A7\u9053\u5E76\u6821\u9A8C\u8FDC\u7AEF agent\u2026",
|
|
782
801
|
"detail.reprovisioning": "\u6B63\u5728\u91CD\u65B0\u5B89\u88C5\u8FDC\u7AEF agent\u2026",
|
|
802
|
+
"detail.restarting": "\u6B63\u5728\u91CD\u542F\u8FDC\u7AEF DSH\u2026",
|
|
783
803
|
"detail.reconnecting": "SSH \u96A7\u9053\u65AD\u5F00\uFF0C\u7B49\u5F85\u91CD\u8FDE\u2026",
|
|
784
804
|
"detail.connectedProxy": "\u5DF2\u8FDE\u63A5\uFF1B\u6A21\u578B\u8BF7\u6C42\u7ECF\u672C\u5730\u51ED\u636E\u4EE3\u7406\u8F6C\u53D1",
|
|
785
805
|
"detail.connectedDirect": "\u5DF2\u8FDE\u63A5\uFF1B\u6A21\u578B\u8BF7\u6C42\u7531\u8FDC\u7AEF\u76F4\u8FDE DeepSeek",
|
|
@@ -880,6 +900,8 @@ var en = {
|
|
|
880
900
|
"settings.connect": "Connect",
|
|
881
901
|
"settings.installing": "Installing\u2026",
|
|
882
902
|
"settings.connecting": "Connecting\u2026",
|
|
903
|
+
"settings.restart": "Restart remote DSH",
|
|
904
|
+
"settings.restarting": "Restarting\u2026",
|
|
883
905
|
"settings.reprovision": "Reinstall",
|
|
884
906
|
"settings.remove": "Remove",
|
|
885
907
|
"settings.workspacePathPlaceholder": "Absolute remote path, e.g. /home/user/project",
|
|
@@ -904,6 +926,7 @@ var en = {
|
|
|
904
926
|
"detail.installing": "Installing DSH and dsh-remote-agent remotely; this takes about 1\u20133 minutes\u2026",
|
|
905
927
|
"detail.connecting": "Opening the SSH tunnel and checking the remote agent\u2026",
|
|
906
928
|
"detail.reprovisioning": "Reinstalling the remote agent\u2026",
|
|
929
|
+
"detail.restarting": "Restarting remote DSH\u2026",
|
|
907
930
|
"detail.reconnecting": "SSH tunnel closed; waiting to reconnect\u2026",
|
|
908
931
|
"detail.connectedProxy": "Connected; model requests go through the local credential proxy",
|
|
909
932
|
"detail.connectedDirect": "Connected; the remote host calls DeepSeek directly",
|