dsh-remote-go 0.0.1 → 0.2.0
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 +87 -7
- package/client.js +8763 -0
- package/cordis.patch.yml +3 -0
- package/index.js +4 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +77 -3
- package/src/admission.js +43 -0
- package/src/api.js +536 -0
- package/src/atomic-json.js +225 -0
- package/src/bootstrap.js +113 -0
- package/src/connect-log.js +176 -0
- package/src/connect-pipeline.js +1900 -0
- package/src/connect-progress.js +155 -0
- package/src/constants.js +93 -0
- package/src/diagnostics.js +160 -0
- package/src/download-jobs.js +234 -0
- package/src/errors.js +412 -0
- package/src/host-lifecycle.js +604 -0
- package/src/host-registry.js +217 -0
- package/src/host-runtime.js +127 -0
- package/src/host-view.js +75 -0
- package/src/index.js +206 -0
- package/src/key-files.js +54 -0
- package/src/known-hosts.js +133 -0
- package/src/layout.js +53 -0
- package/src/local-download.js +381 -0
- package/src/local-ssh.js +27 -0
- package/src/local-version.js +88 -0
- package/src/node-runtime.js +521 -0
- package/src/probe.js +101 -0
- package/src/prompts.js +229 -0
- package/src/redact.js +68 -0
- package/src/remote-files.js +71 -0
- package/src/remote-path.js +137 -0
- package/src/remote-proc.js +343 -0
- package/src/remote-proxy.js +815 -0
- package/src/remote-web.js +751 -0
- package/src/request-trust.js +89 -0
- package/src/secrets.js +109 -0
- package/src/service.js +459 -0
- package/src/settings.js +163 -0
- package/src/ssh-config.js +271 -0
- package/src/ssh.js +731 -0
- package/src/store.js +193 -0
- package/src/tools.js +386 -0
- package/src/tunnel.js +132 -0
- package/src/util.js +153 -0
- package/src/version.js +103 -0
- package/src/webapp.js +43 -0
- package/vendor/THIRD_PARTY_NOTICES.md +36 -0
- package/vendor/ssh2.bundle.cjs +25 -0
package/cordis.patch.yml
ADDED
package/index.js
ADDED
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "dsh-remote-go",
|
|
4
|
+
"description": "Use a remote DSH over SSH inside your local DSH: the sidebar host bar switches between Local and each host, the remote UI takes over the whole window and comes back without reloading; the connect flow shows staged progress and a live log, and you can restart or stop the remote DSH, download remote files and folders, and expose a read-only host list to local AI sessions. The remote runs on a plugin-managed Node with npx pinned to the local version, keeping its data in the remote ~/.dsh."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-go",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "DSH 插件:在本地 DSH 里通过 SSH 使用远端 DSH(主机条切换、整窗接管、连接进度与日志、重启/关闭远端、远端文件下载、只读主机列表;插件自带 Node + npx,数据留在远端 ~/.dsh) | DSH plugin: use a remote DSH over SSH inside your local DSH (host switcher, full-window UI, connect progress and log, remote restart/stop, remote file downloads, read-only host list; plugin-managed Node + npx, data stays in the remote ~/.dsh)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek",
|
|
7
7
|
"harness",
|
|
8
8
|
"dsh",
|
|
9
9
|
"dsh-plugin",
|
|
10
10
|
"remote",
|
|
11
|
-
"ssh"
|
|
11
|
+
"ssh",
|
|
12
|
+
"remote-development"
|
|
12
13
|
],
|
|
13
14
|
"license": "MIT",
|
|
14
15
|
"author": "Solaris136",
|
|
@@ -20,8 +21,81 @@
|
|
|
20
21
|
"type": "git",
|
|
21
22
|
"url": "git+https://github.com/Solaris136/dsh-remote-go.git"
|
|
22
23
|
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"packageManager": "pnpm@11.28.9",
|
|
26
|
+
"engines": {
|
|
27
|
+
"dsh": ">=0.2.2-rc.3",
|
|
28
|
+
"node": ">=24"
|
|
29
|
+
},
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"./client.js"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./index.js",
|
|
35
|
+
"./client": "./client.js",
|
|
36
|
+
"./locale/*.json": "./locale/*.json",
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"index.js",
|
|
41
|
+
"client.js",
|
|
42
|
+
"src",
|
|
43
|
+
"vendor/ssh2.bundle.cjs",
|
|
44
|
+
"vendor/THIRD_PARTY_NOTICES.md",
|
|
45
|
+
"locale",
|
|
46
|
+
"cordis.patch.yml",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
50
|
+
"dsh": {
|
|
51
|
+
"bundle": {
|
|
52
|
+
"patch": "./cordis.patch.yml"
|
|
53
|
+
},
|
|
54
|
+
"client": {
|
|
55
|
+
"platform": "web",
|
|
56
|
+
"immediately": true,
|
|
57
|
+
"inject": [
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
59
|
+
"@deepseek-ai/dsh-client-locale"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
23
63
|
"publishConfig": {
|
|
24
64
|
"access": "public",
|
|
25
65
|
"registry": "https://registry.npmjs.org/"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"esbuild": "^0.28.2",
|
|
70
|
+
"js-yaml": "^5.5.0",
|
|
71
|
+
"prettier": "^3.10.1",
|
|
72
|
+
"puppeteer-core": "^25.17.0",
|
|
73
|
+
"react": "^19.3.1",
|
|
74
|
+
"react-dom": "^19.3.1",
|
|
75
|
+
"ssh2": "1.17.0"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"test": "node --test \"test/unit/*.test.js\"",
|
|
79
|
+
"test:unit": "node --test \"test/unit/*.test.js\"",
|
|
80
|
+
"test:web": "node --test \"test/integration/web.e2e.js\"",
|
|
81
|
+
"test:desktop": "node --test \"test/integration/desktop.e2e.js\"",
|
|
82
|
+
"test:integration": "node --test --test-concurrency=1 \"test/integration/*.test.js\" \"test/integration/*.e2e.js\"",
|
|
83
|
+
"test:integration:local": "node --test --test-concurrency=1 test/integration/sim.test.js test/integration/remote-restart.test.js test/integration/stop-remote.test.js",
|
|
84
|
+
"test:integration:external": "node --test --test-concurrency=1 test/integration/client-ui.test.js test/integration/remote-proxy.test.js test/integration/web.e2e.js test/integration/browser-carrier.test.js test/integration/guest-tools.e2e.js test/integration/stop-remote.browser.test.js",
|
|
85
|
+
"sim:remote": "node e2e/sim/simulated-remote.mjs --self-test",
|
|
86
|
+
"test:coverage": "node scripts/check-coverage.mjs",
|
|
87
|
+
"lint": "node scripts/check-repo.mjs",
|
|
88
|
+
"check:repo": "node scripts/check-repo.mjs",
|
|
89
|
+
"check:syntax": "node scripts/check-syntax.mjs",
|
|
90
|
+
"check:workflows": "node scripts/check-workflows.mjs",
|
|
91
|
+
"check:pr-title": "node scripts/check-pr-title.mjs",
|
|
92
|
+
"format": "prettier --write .",
|
|
93
|
+
"format:check": "prettier --check .",
|
|
94
|
+
"gate": "node scripts/check-repo.mjs && prettier --check . && node scripts/check-syntax.mjs && node scripts/check-workflows.mjs && node scripts/pack-check.mjs && node scripts/check-coverage.mjs",
|
|
95
|
+
"verify": "node scripts/check-repo.mjs && prettier --check . && node scripts/check-syntax.mjs && node scripts/check-workflows.mjs && node scripts/pack-check.mjs && node scripts/check-coverage.mjs && node --test --test-concurrency=1 \"test/integration/*.test.js\" \"test/integration/*.e2e.js\"",
|
|
96
|
+
"build:vendor": "node scripts/build-vendor.mjs",
|
|
97
|
+
"pack:check": "node scripts/pack-check.mjs",
|
|
98
|
+
"pack:check:tarball": "node scripts/pack-check.mjs --find artifacts",
|
|
99
|
+
"prepack": "node scripts/build-vendor.mjs && git diff --exit-code -- vendor/"
|
|
26
100
|
}
|
|
27
101
|
}
|
package/src/admission.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH's own admission for the routes this plugin serves.
|
|
3
|
+
*
|
|
4
|
+
* The kernel decides whether a request may reach a Host feature at all: its `Host`/`Origin` fence
|
|
5
|
+
* plus browser authentication against a live Peer (`ctx.connection.requestRejection`). This module
|
|
6
|
+
* is the one place that turns that service into a per-request function, so the local API and the
|
|
7
|
+
* same-origin proxy share the gate and both failure modes stay testable.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Build the admission gate for one plugin activation.
|
|
12
|
+
*
|
|
13
|
+
* `connection` is optional and has to be read through `ctx.get`: Cordis throws when a plugin reads
|
|
14
|
+
* a service its fiber did not inject, and an older kernel may not provide the service at all. In
|
|
15
|
+
* both cases the gate returns `undefined`, which hands the request to the caller's own fence
|
|
16
|
+
* instead of going dark. A gate that throws while judging a request returns `500` — failing closed,
|
|
17
|
+
* because a check that cannot decide must never admit.
|
|
18
|
+
*
|
|
19
|
+
* @param {object} ctx - plugin context; only `ctx.get` is read, and it may be missing in tests.
|
|
20
|
+
* @param {{ warn?: (...args: any[]) => void }} [logger]
|
|
21
|
+
* @returns {(req: { headers: object }) => (number | undefined)} rejection status, or undefined to admit.
|
|
22
|
+
*/
|
|
23
|
+
export function createAdmission(ctx, logger = console) {
|
|
24
|
+
const warn = typeof logger.warn === 'function' ? logger.warn.bind(logger) : () => {}
|
|
25
|
+
|
|
26
|
+
return (req) => {
|
|
27
|
+
let connection = null
|
|
28
|
+
try {
|
|
29
|
+
connection = typeof ctx?.get === 'function' ? ctx.get('connection') : null
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// A failed lookup says nothing about this request, so the caller's own fence decides it.
|
|
32
|
+
warn('[dsh-remote-go] DSH connection lookup failed; the local fence stays the only gate:', error)
|
|
33
|
+
return undefined
|
|
34
|
+
}
|
|
35
|
+
if (!connection || typeof connection.requestRejection !== 'function') return undefined
|
|
36
|
+
try {
|
|
37
|
+
return connection.requestRejection(req)
|
|
38
|
+
} catch (error) {
|
|
39
|
+
warn('[dsh-remote-go] DSH connection admission failed; rejecting the request:', error)
|
|
40
|
+
return 500
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|