dsh-remote-vs 0.28.0 → 0.30.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.en.md +63 -7
- package/README.md +51 -7
- package/lib/client.js +393 -112
- package/lib/index.js +2271 -160
- package/lib/p2-router-fs.js +1 -1
- package/lib/types/changes/recorder.d.ts +65 -10
- package/lib/types/changes/status.d.ts +48 -3
- package/lib/types/client/ConnectionsSection.d.ts +73 -0
- package/lib/types/client/HostsView.d.ts +139 -2
- package/lib/types/client/api.d.ts +65 -2
- package/lib/types/client/connection.d.ts +28 -1
- package/lib/types/client/scm/actions.d.ts +25 -1
- package/lib/types/forward.d.ts +11 -1
- package/lib/types/p2/helper-rpc.d.ts +48 -0
- package/lib/types/p2/worlds.d.ts +28 -0
- package/lib/types/pool.d.ts +337 -8
- package/lib/types/protocol.d.ts +218 -0
- package/lib/types/proxy.d.ts +136 -0
- package/lib/types/store.d.ts +81 -1
- package/lib/types/tools.d.ts +3 -0
- package/lib/{worlds-RG8K5eom.js → worlds-CRRZMZhg.js} +85 -6
- package/package.json +1 -1
- package/src/changes/recorder.ts +151 -15
- package/src/changes/status.ts +59 -4
- package/src/client/ConnectionStatus.tsx +19 -5
- package/src/client/ConnectionsSection.tsx +359 -0
- package/src/client/HostsView.tsx +552 -11
- package/src/client/MonitorView.tsx +14 -0
- package/src/client/PortsView.tsx +16 -0
- package/src/client/SettingsHosts.tsx +132 -6
- package/src/client/api.ts +102 -4
- package/src/client/connection.ts +76 -2
- package/src/client/i18n.ts +152 -2
- package/src/client/scm/actions.ts +63 -12
- package/src/client/vsc/vsc.css +281 -0
- package/src/forward.ts +38 -2
- package/src/importers.ts +125 -13
- package/src/keygen.ts +8 -1
- package/src/p2/helper-rpc.ts +73 -5
- package/src/p2/worlds.ts +48 -0
- package/src/pool.ts +1120 -100
- package/src/protocol.ts +228 -0
- package/src/proxy.ts +673 -0
- package/src/routes.ts +139 -5
- package/src/store.ts +335 -0
- package/src/tools.ts +47 -2
package/src/tools.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { ContentBlock } from '@deepseek-ai/dsh-llm'
|
|
|
8
8
|
import type { RemotePool } from './pool.ts'
|
|
9
9
|
import { RemoteFiles } from './sftp.ts'
|
|
10
10
|
import type { RemoteStore } from './store.ts'
|
|
11
|
-
import type { RemoteExecResult, RemoteHostSummary } from './protocol.ts'
|
|
11
|
+
import type { RemoteExecResult, RemoteHostProxyView, RemoteHostSummary } from './protocol.ts'
|
|
12
12
|
import { clampExecTimeout, MAX_TIMEOUT_MS } from './timeouts.ts'
|
|
13
13
|
|
|
14
14
|
function text(value: string): ContentBlock[] {
|
|
@@ -26,6 +26,8 @@ export interface AgentHostRow {
|
|
|
26
26
|
managedKey: boolean
|
|
27
27
|
description?: string
|
|
28
28
|
tags: string[]
|
|
29
|
+
/** Effective network route (secret-free), as the host list reports it. */
|
|
30
|
+
proxy: RemoteHostProxyView
|
|
29
31
|
createdAt: number
|
|
30
32
|
updatedAt: number
|
|
31
33
|
}
|
|
@@ -41,11 +43,28 @@ function toAgentHostRow(host: RemoteHostSummary): AgentHostRow {
|
|
|
41
43
|
managedKey: host.managedKey,
|
|
42
44
|
...(host.description !== undefined ? { description: host.description } : {}),
|
|
43
45
|
tags: [...host.tags],
|
|
46
|
+
proxy: host.proxy,
|
|
44
47
|
createdAt: host.createdAt,
|
|
45
48
|
updatedAt: host.updatedAt,
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
|
|
52
|
+
/**
|
|
53
|
+
* One-line description of a host's effective route, for the agent table.
|
|
54
|
+
*
|
|
55
|
+
* `problem` is part of the value (not a separate column): a host whose jump target
|
|
56
|
+
* was deleted is still listed, and the caller must see why it would fail.
|
|
57
|
+
*/
|
|
58
|
+
function proxyLabel(proxy: RemoteHostProxyView): string {
|
|
59
|
+
const target = proxy.target === undefined ? '' : ` ${proxy.target.host}:${proxy.target.port}`
|
|
60
|
+
const route = proxy.mode === 'proxy'
|
|
61
|
+
? `proxy${target}`
|
|
62
|
+
: proxy.mode === 'jump'
|
|
63
|
+
? `jump ${proxy.jumpVia ?? '?'}`
|
|
64
|
+
: proxy.mode
|
|
65
|
+
return proxy.problem === undefined ? route : `${route} (problem: ${proxy.problem})`
|
|
66
|
+
}
|
|
67
|
+
|
|
49
68
|
/**
|
|
50
69
|
* Render the host table.
|
|
51
70
|
*
|
|
@@ -63,10 +82,15 @@ function renderHosts(hosts: RemoteHostSummary[], query?: string): string {
|
|
|
63
82
|
const rows = hosts.map(h => [
|
|
64
83
|
h.alias, h.host, String(h.port), h.user, h.auth,
|
|
65
84
|
h.auth === 'key' ? (h.keyReady ? 'key-ok' : 'key-missing') : 'password',
|
|
85
|
+
proxyLabel(h.proxy),
|
|
66
86
|
h.tags.length > 0 ? h.tags.join(',') : '-',
|
|
67
87
|
h.description ?? '',
|
|
68
88
|
].join(' | '))
|
|
69
|
-
return [
|
|
89
|
+
return [
|
|
90
|
+
'alias | host | port | user | auth | key | proxy | tags | description',
|
|
91
|
+
'--- | --- | --- | --- | --- | --- | --- | --- | ---',
|
|
92
|
+
...rows,
|
|
93
|
+
].join('\n')
|
|
70
94
|
}
|
|
71
95
|
|
|
72
96
|
/**
|
|
@@ -139,6 +163,27 @@ export function remoteHostsTool(deps: RemoteToolsDeps): ReturnType<typeof define
|
|
|
139
163
|
managedKey: { type: 'boolean', required: true },
|
|
140
164
|
description: { type: 'string' },
|
|
141
165
|
tags: { type: 'array', items: { type: 'string' }, required: true },
|
|
166
|
+
proxy: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
additionalProperties: false,
|
|
169
|
+
required: true,
|
|
170
|
+
properties: {
|
|
171
|
+
mode: { type: 'string', enum: ['inherit', 'direct', 'proxy', 'jump'], required: true },
|
|
172
|
+
target: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
additionalProperties: false,
|
|
175
|
+
properties: {
|
|
176
|
+
kind: { type: 'string', enum: ['http', 'socks5'], required: true },
|
|
177
|
+
host: { type: 'string', required: true },
|
|
178
|
+
port: { type: 'integer', required: true },
|
|
179
|
+
username: { type: 'string' },
|
|
180
|
+
hasPassword: { type: 'boolean', required: true },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
jumpVia: { type: 'string' },
|
|
184
|
+
problem: { type: 'string' },
|
|
185
|
+
},
|
|
186
|
+
},
|
|
142
187
|
createdAt: { type: 'integer', required: true },
|
|
143
188
|
updatedAt: { type: 'integer', required: true },
|
|
144
189
|
},
|